<html>
<head>
    <title>Object.js Source Code | Sencha Test 1.0.3</title>
    <!--  Generated on  -->
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
    <pre class="editor editor-colors"><div class="line"><a name="line1"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line2"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@class</span></span><span>&nbsp;Object</span></span></span></div><div class="line"><a name="line3"><a name="Object"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line4"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Creates&nbsp;an&nbsp;object&nbsp;wrapper.</span></span></span></div><div class="line"><a name="line5"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line6"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;Object&nbsp;constructor&nbsp;creates&nbsp;an&nbsp;object&nbsp;wrapper&nbsp;for&nbsp;the&nbsp;given&nbsp;value.&nbsp;If&nbsp;the&nbsp;value&nbsp;is&nbsp;null&nbsp;or</span></span></span></div><div class="line"><a name="line7"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;undefined,&nbsp;it&nbsp;will&nbsp;create&nbsp;and&nbsp;return&nbsp;an&nbsp;empty&nbsp;object,&nbsp;otherwise,&nbsp;it&nbsp;will&nbsp;return&nbsp;an&nbsp;object&nbsp;of&nbsp;a&nbsp;type</span></span></span></div><div class="line"><a name="line8"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;that&nbsp;corresponds&nbsp;to&nbsp;the&nbsp;given&nbsp;value.</span></span></span></div><div class="line"><a name="line9"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line10"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;When&nbsp;called&nbsp;in&nbsp;a&nbsp;non-constructor&nbsp;context,&nbsp;Object&nbsp;behaves&nbsp;identically.</span></span></span></div><div class="line"><a name="line11"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line12"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;#&nbsp;Using&nbsp;Object&nbsp;given&nbsp;undefined&nbsp;and&nbsp;null&nbsp;types</span></span></span></div><div class="line"><a name="line13"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line14"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;examples&nbsp;store&nbsp;an&nbsp;empty&nbsp;Object&nbsp;object&nbsp;in&nbsp;o:</span></span></span></div><div class="line"><a name="line15"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;o&nbsp;=&nbsp;new&nbsp;Object();</span></span></span></div><div class="line"><a name="line16"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line17"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;o&nbsp;=&nbsp;new&nbsp;Object(undefined);</span></span></span></div><div class="line"><a name="line18"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line19"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;o&nbsp;=&nbsp;new&nbsp;Object(null);</span></span></span></div><div class="line"><a name="line20"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line21"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;#&nbsp;Using&nbsp;Object&nbsp;to&nbsp;create&nbsp;Boolean&nbsp;objects</span></span></span></div><div class="line"><a name="line22"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line23"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;examples&nbsp;store&nbsp;Boolean&nbsp;objects&nbsp;in&nbsp;o:</span></span></span></div><div class="line"><a name="line24"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line25"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;equivalent&nbsp;to&nbsp;o&nbsp;=&nbsp;new&nbsp;Boolean(true);</span></span></span></div><div class="line"><a name="line26"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;o&nbsp;=&nbsp;new&nbsp;Object(true);</span></span></span></div><div class="line"><a name="line27"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line28"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;equivalent&nbsp;to&nbsp;o&nbsp;=&nbsp;new&nbsp;Boolean(false);</span></span></span></div><div class="line"><a name="line29"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;o&nbsp;=&nbsp;new&nbsp;Object(Boolean());</span></span></span></div><div class="line"><a name="line30"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line31"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&lt;div&nbsp;class=&quot;notice&quot;&gt;</span></span></span></div><div class="line"><a name="line32"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Documentation&nbsp;for&nbsp;this&nbsp;class&nbsp;comes&nbsp;from&nbsp;[MDN](</span><span class="markup underline link https hyperlink"><span>https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object</span></span><span>)</span></span></span></div><div class="line"><a name="line33"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;and&nbsp;is&nbsp;available&nbsp;under&nbsp;[Creative&nbsp;Commons:&nbsp;Attribution-Sharealike&nbsp;license](</span><span class="markup underline link http hyperlink"><span>http://creativecommons.org/licenses/by-sa/2.0/</span></span><span>).</span></span></span></div><div class="line"><a name="line34"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&lt;/div&gt;</span></span></span></div><div class="line"><a name="line35"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line36"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line37"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line38"><a name="Object-method-constructor"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;constructor</span></span></span></div><div class="line"><a name="line39"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Creates&nbsp;new&nbsp;Object.</span></span></span></div><div class="line"><a name="line40"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{Object}&nbsp;[value]&nbsp;The&nbsp;value&nbsp;to&nbsp;wrap.</span></span></span></div><div class="line"><a name="line41"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line42"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line43"><span class="source js"><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>Properties</span><span>&nbsp;</span></span></span></div><div class="line"><a name="line44"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line45"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line46"><a name="Object-property-prototype"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@property</span></span><span>&nbsp;prototype</span></span></span></div><div class="line"><a name="line47"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Allows&nbsp;the&nbsp;addition&nbsp;of&nbsp;properties&nbsp;to&nbsp;all&nbsp;objects&nbsp;of&nbsp;type&nbsp;Object.</span></span></span></div><div class="line"><a name="line48"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line49"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line50"><span class="source js"><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>Methods</span><span>&nbsp;</span></span></span></div><div class="line"><a name="line51"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line52"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line53"><a name="Object-method-hasOwnProperty"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;hasOwnProperty</span></span></span></div><div class="line"><a name="line54"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;a&nbsp;boolean&nbsp;indicating&nbsp;whether&nbsp;an&nbsp;object&nbsp;contains&nbsp;the&nbsp;specified&nbsp;property&nbsp;as&nbsp;a&nbsp;direct&nbsp;property</span></span></span></div><div class="line"><a name="line55"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;of&nbsp;that&nbsp;object&nbsp;and&nbsp;not&nbsp;inherited&nbsp;through&nbsp;the&nbsp;prototype&nbsp;chain.</span></span></span></div><div class="line"><a name="line56"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line57"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Every&nbsp;object&nbsp;descended&nbsp;from&nbsp;`Object`&nbsp;inherits&nbsp;the&nbsp;`hasOwnProperty`&nbsp;method.&nbsp;This&nbsp;method&nbsp;can&nbsp;be&nbsp;used</span></span></span></div><div class="line"><a name="line58"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;to&nbsp;determine&nbsp;whether&nbsp;an&nbsp;object&nbsp;has&nbsp;the&nbsp;specified&nbsp;property&nbsp;as&nbsp;a&nbsp;direct&nbsp;property&nbsp;of&nbsp;that&nbsp;object;</span></span></span></div><div class="line"><a name="line59"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;unlike&nbsp;the&nbsp;`in`&nbsp;operator,&nbsp;this&nbsp;method&nbsp;does&nbsp;not&nbsp;check&nbsp;down&nbsp;the&nbsp;object&#39;s&nbsp;prototype&nbsp;chain.</span></span></span></div><div class="line"><a name="line60"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line61"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;example&nbsp;determines&nbsp;whether&nbsp;the&nbsp;o&nbsp;object&nbsp;contains&nbsp;a&nbsp;property&nbsp;named&nbsp;prop:</span></span></span></div><div class="line"><a name="line62"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line63"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;new&nbsp;Object();</span></span></span></div><div class="line"><a name="line64"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.prop&nbsp;=&nbsp;&#39;exists&#39;;</span></span></span></div><div class="line"><a name="line65"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line66"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;changeO()&nbsp;{</span></span></span></div><div class="line"><a name="line67"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.newprop&nbsp;=&nbsp;o.prop;</span></span></span></div><div class="line"><a name="line68"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete&nbsp;o.prop;</span></span></span></div><div class="line"><a name="line69"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line70"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line71"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.hasOwnProperty(&#39;prop&#39;);&nbsp;&nbsp;&nbsp;//returns&nbsp;true</span></span></span></div><div class="line"><a name="line72"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;changeO();</span></span></span></div><div class="line"><a name="line73"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.hasOwnProperty(&#39;prop&#39;);&nbsp;&nbsp;&nbsp;//returns&nbsp;false</span></span></span></div><div class="line"><a name="line74"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line75"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;example&nbsp;differentiates&nbsp;between&nbsp;direct&nbsp;properties&nbsp;and&nbsp;properties&nbsp;inherited&nbsp;through&nbsp;the</span></span></span></div><div class="line"><a name="line76"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;prototype&nbsp;chain:</span></span></span></div><div class="line"><a name="line77"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line78"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;new&nbsp;Object();</span></span></span></div><div class="line"><a name="line79"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.prop&nbsp;=&nbsp;&#39;exists&#39;;</span></span></span></div><div class="line"><a name="line80"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.hasOwnProperty(&#39;prop&#39;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;true</span></span></span></div><div class="line"><a name="line81"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.hasOwnProperty(&#39;toString&#39;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;false</span></span></span></div><div class="line"><a name="line82"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.hasOwnProperty(&#39;hasOwnProperty&#39;);&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;false</span></span></span></div><div class="line"><a name="line83"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line84"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;example&nbsp;shows&nbsp;how&nbsp;to&nbsp;iterate&nbsp;over&nbsp;the&nbsp;properties&nbsp;of&nbsp;an&nbsp;object&nbsp;without&nbsp;executing&nbsp;on</span></span></span></div><div class="line"><a name="line85"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;inherit&nbsp;properties.</span></span></span></div><div class="line"><a name="line86"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line87"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;buz&nbsp;=&nbsp;{</span></span></span></div><div class="line"><a name="line88"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fog:&nbsp;&#39;stack&#39;</span></span></span></div><div class="line"><a name="line89"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></span></span></div><div class="line"><a name="line90"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line91"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;name&nbsp;in&nbsp;buz)&nbsp;{</span></span></span></div><div class="line"><a name="line92"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(buz.hasOwnProperty(name))&nbsp;{</span></span></span></div><div class="line"><a name="line93"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;this&nbsp;is&nbsp;fog&nbsp;(&quot;&nbsp;+&nbsp;name&nbsp;+&nbsp;&quot;)&nbsp;for&nbsp;sure.&nbsp;Value:&nbsp;&quot;&nbsp;+&nbsp;buz[name]);</span></span></span></div><div class="line"><a name="line94"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line95"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{</span></span></span></div><div class="line"><a name="line96"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(name);&nbsp;//&nbsp;toString&nbsp;or&nbsp;something&nbsp;else</span></span></span></div><div class="line"><a name="line97"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line98"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line99"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line100"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>prop</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;name&nbsp;of&nbsp;the&nbsp;property&nbsp;to&nbsp;test.</span></span></span></span></span></div><div class="line"><a name="line101"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Boolean}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>Returns</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>true&nbsp;if&nbsp;object&nbsp;contains&nbsp;specified&nbsp;property;&nbsp;else</span></span></span></span></span></div><div class="line"><a name="line102"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;returns&nbsp;false.</span></span></span></div><div class="line"><a name="line103"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line104"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line105"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line106"><a name="Object-method-isPrototypeOf"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;isPrototypeOf</span></span></span></div><div class="line"><a name="line107"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;a&nbsp;boolean&nbsp;indication&nbsp;whether&nbsp;the&nbsp;specified&nbsp;object&nbsp;is&nbsp;in&nbsp;the&nbsp;prototype&nbsp;chain&nbsp;of&nbsp;the&nbsp;object</span></span></span></div><div class="line"><a name="line108"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;this&nbsp;method&nbsp;is&nbsp;called&nbsp;upon.</span></span></span></div><div class="line"><a name="line109"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line110"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;`isPrototypeOf`&nbsp;allows&nbsp;you&nbsp;to&nbsp;check&nbsp;whether&nbsp;or&nbsp;not&nbsp;an&nbsp;object&nbsp;exists&nbsp;within&nbsp;another&nbsp;object&#39;s</span></span></span></div><div class="line"><a name="line111"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;prototype&nbsp;chain.</span></span></span></div><div class="line"><a name="line112"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line113"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;For&nbsp;example,&nbsp;consider&nbsp;the&nbsp;following&nbsp;prototype&nbsp;chain:</span></span></span></div><div class="line"><a name="line114"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line115"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Fee()&nbsp;{</span></span></span></div><div class="line"><a name="line116"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;.&nbsp;.&nbsp;.</span></span></span></div><div class="line"><a name="line117"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line118"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line119"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Fi()&nbsp;{</span></span></span></div><div class="line"><a name="line120"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;.&nbsp;.&nbsp;.</span></span></span></div><div class="line"><a name="line121"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line122"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fi.prototype&nbsp;=&nbsp;new&nbsp;Fee();</span></span></span></div><div class="line"><a name="line123"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line124"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Fo()&nbsp;{</span></span></span></div><div class="line"><a name="line125"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;.&nbsp;.&nbsp;.</span></span></span></div><div class="line"><a name="line126"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line127"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fo.prototype&nbsp;=&nbsp;new&nbsp;Fi();</span></span></span></div><div class="line"><a name="line128"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line129"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Fum()&nbsp;{</span></span></span></div><div class="line"><a name="line130"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;.&nbsp;.&nbsp;.</span></span></span></div><div class="line"><a name="line131"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line132"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fum.prototype&nbsp;=&nbsp;new&nbsp;Fo();</span></span></span></div><div class="line"><a name="line133"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line134"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Later&nbsp;on&nbsp;down&nbsp;the&nbsp;road,&nbsp;if&nbsp;you&nbsp;instantiate&nbsp;`Fum`&nbsp;and&nbsp;need&nbsp;to&nbsp;check&nbsp;if&nbsp;`Fi`&#39;s&nbsp;prototype&nbsp;exists</span></span></span></div><div class="line"><a name="line135"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;within&nbsp;the&nbsp;`Fum`&nbsp;prototype&nbsp;chain,&nbsp;you&nbsp;could&nbsp;do&nbsp;this:</span></span></span></div><div class="line"><a name="line136"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line137"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;fum&nbsp;=&nbsp;new&nbsp;Fum();</span></span></span></div><div class="line"><a name="line138"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;.&nbsp;.</span></span></span></div><div class="line"><a name="line139"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line140"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(Fi.prototype.isPrototypeOf(fum))&nbsp;{</span></span></span></div><div class="line"><a name="line141"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;do&nbsp;something&nbsp;safe</span></span></span></div><div class="line"><a name="line142"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line143"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line144"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This,&nbsp;along&nbsp;with&nbsp;the&nbsp;`instanceof`&nbsp;operator&nbsp;particularly&nbsp;comes&nbsp;in&nbsp;handy&nbsp;if&nbsp;you&nbsp;have&nbsp;code&nbsp;that&nbsp;can</span></span></span></div><div class="line"><a name="line145"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;only&nbsp;function&nbsp;when&nbsp;dealing&nbsp;with&nbsp;objects&nbsp;descended&nbsp;from&nbsp;a&nbsp;specific&nbsp;prototype&nbsp;chain,&nbsp;e.g.,&nbsp;to</span></span></span></div><div class="line"><a name="line146"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;guarantee&nbsp;that&nbsp;certain&nbsp;methods&nbsp;or&nbsp;properties&nbsp;will&nbsp;be&nbsp;present&nbsp;on&nbsp;that&nbsp;object.</span></span></span></div><div class="line"><a name="line147"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line148"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>prototype</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>an&nbsp;object&nbsp;to&nbsp;be&nbsp;tested&nbsp;against&nbsp;each&nbsp;link&nbsp;in&nbsp;the&nbsp;prototype&nbsp;chain&nbsp;of&nbsp;the</span></span></span></span></span></div><div class="line"><a name="line149"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;*object*&nbsp;argument</span></span></span></div><div class="line"><a name="line150"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>object</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>the&nbsp;object&nbsp;whose&nbsp;prototype&nbsp;chain&nbsp;will&nbsp;be&nbsp;searched</span></span></span></span></span></div><div class="line"><a name="line151"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Boolean}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>Returns</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>true&nbsp;if&nbsp;object&nbsp;is&nbsp;a&nbsp;prototype&nbsp;and&nbsp;false&nbsp;if&nbsp;not.</span></span></span></span></span></div><div class="line"><a name="line152"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line153"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line154"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line155"><a name="Object-method-propertyIsEnumerable"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;propertyIsEnumerable</span></span></span></div><div class="line"><a name="line156"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;a&nbsp;boolean&nbsp;indicating&nbsp;if&nbsp;the&nbsp;internal&nbsp;ECMAScript&nbsp;DontEnum&nbsp;attribute&nbsp;is&nbsp;set.</span></span></span></div><div class="line"><a name="line157"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line158"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Every&nbsp;object&nbsp;has&nbsp;a&nbsp;`propertyIsEnumerable`&nbsp;method.&nbsp;This&nbsp;method&nbsp;can&nbsp;determine&nbsp;whether&nbsp;the&nbsp;specified</span></span></span></div><div class="line"><a name="line159"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;property&nbsp;in&nbsp;an&nbsp;object&nbsp;can&nbsp;be&nbsp;enumerated&nbsp;by&nbsp;a&nbsp;`for...in`&nbsp;loop,&nbsp;with&nbsp;the&nbsp;exception&nbsp;of&nbsp;properties</span></span></span></div><div class="line"><a name="line160"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;inherited&nbsp;through&nbsp;the&nbsp;prototype&nbsp;chain.&nbsp;If&nbsp;the&nbsp;object&nbsp;does&nbsp;not&nbsp;have&nbsp;the&nbsp;specified&nbsp;property,&nbsp;this</span></span></span></div><div class="line"><a name="line161"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;method&nbsp;returns&nbsp;false.</span></span></span></div><div class="line"><a name="line162"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line163"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;example&nbsp;shows&nbsp;the&nbsp;use&nbsp;of&nbsp;`propertyIsEnumerable`&nbsp;on&nbsp;objects&nbsp;and&nbsp;arrays:</span></span></span></div><div class="line"><a name="line164"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line165"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;o&nbsp;=&nbsp;{};</span></span></span></div><div class="line"><a name="line166"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;a&nbsp;=&nbsp;[];</span></span></span></div><div class="line"><a name="line167"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.prop&nbsp;=&nbsp;&#39;is&nbsp;enumerable&#39;;</span></span></span></div><div class="line"><a name="line168"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a[0]&nbsp;=&nbsp;&#39;is&nbsp;enumerable&#39;;</span></span></span></div><div class="line"><a name="line169"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line170"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.propertyIsEnumerable(&#39;prop&#39;);&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;true</span></span></span></div><div class="line"><a name="line171"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.propertyIsEnumerable(0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;true</span></span></span></div><div class="line"><a name="line172"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line173"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;example&nbsp;demonstrates&nbsp;the&nbsp;enumerability&nbsp;of&nbsp;user-defined&nbsp;versus&nbsp;built-in&nbsp;properties:</span></span></span></div><div class="line"><a name="line174"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line175"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;a&nbsp;=&nbsp;[&#39;is&nbsp;enumerable&#39;];</span></span></span></div><div class="line"><a name="line176"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line177"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.propertyIsEnumerable(0);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;true</span></span></span></div><div class="line"><a name="line178"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.propertyIsEnumerable(&#39;length&#39;);&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;false</span></span></span></div><div class="line"><a name="line179"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line180"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Math.propertyIsEnumerable(&#39;random&#39;);&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;false</span></span></span></div><div class="line"><a name="line181"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.propertyIsEnumerable(&#39;Math&#39;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;false</span></span></span></div><div class="line"><a name="line182"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line183"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Direct&nbsp;versus&nbsp;inherited&nbsp;properties</span></span></span></div><div class="line"><a name="line184"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line185"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;a&nbsp;=&nbsp;[];</span></span></span></div><div class="line"><a name="line186"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.propertyIsEnumerable(&#39;constructor&#39;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;false</span></span></span></div><div class="line"><a name="line187"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line188"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;firstConstructor()</span></span></span></div><div class="line"><a name="line189"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></span></span></div><div class="line"><a name="line190"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.property&nbsp;=&nbsp;&#39;is&nbsp;not&nbsp;enumerable&#39;;</span></span></span></div><div class="line"><a name="line191"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line192"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;firstConstructor.prototype.firstMethod&nbsp;=&nbsp;function&nbsp;()&nbsp;{};</span></span></span></div><div class="line"><a name="line193"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line194"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;secondConstructor()</span></span></span></div><div class="line"><a name="line195"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</span></span></span></div><div class="line"><a name="line196"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.method&nbsp;=&nbsp;function&nbsp;method()&nbsp;{&nbsp;return&nbsp;&#39;is&nbsp;enumerable&#39;;&nbsp;};</span></span></span></div><div class="line"><a name="line197"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line198"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line199"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;secondConstructor.prototype&nbsp;=&nbsp;new&nbsp;firstConstructor;</span></span></span></div><div class="line"><a name="line200"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;secondConstructor.prototype.constructor&nbsp;=&nbsp;secondConstructor;</span></span></span></div><div class="line"><a name="line201"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line202"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;o&nbsp;=&nbsp;new&nbsp;secondConstructor();</span></span></span></div><div class="line"><a name="line203"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.arbitraryProperty&nbsp;=&nbsp;&#39;is&nbsp;enumerable&#39;;</span></span></span></div><div class="line"><a name="line204"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line205"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.propertyIsEnumerable(&#39;arbitraryProperty&#39;);&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;true</span></span></span></div><div class="line"><a name="line206"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.propertyIsEnumerable(&#39;method&#39;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;true</span></span></span></div><div class="line"><a name="line207"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.propertyIsEnumerable(&#39;property&#39;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;false</span></span></span></div><div class="line"><a name="line208"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line209"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.property&nbsp;=&nbsp;&#39;is&nbsp;enumerable&#39;;</span></span></span></div><div class="line"><a name="line210"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line211"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.propertyIsEnumerable(&#39;property&#39;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;true</span></span></span></div><div class="line"><a name="line212"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line213"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;These&nbsp;return&nbsp;false&nbsp;as&nbsp;they&nbsp;are&nbsp;on&nbsp;the&nbsp;prototype&nbsp;which</span></span></span></div><div class="line"><a name="line214"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;propertyIsEnumerable&nbsp;does&nbsp;not&nbsp;consider&nbsp;(even&nbsp;though&nbsp;the&nbsp;last&nbsp;two</span></span></span></div><div class="line"><a name="line215"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;are&nbsp;iteratable&nbsp;with&nbsp;for-in)</span></span></span></div><div class="line"><a name="line216"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.propertyIsEnumerable(&#39;prototype&#39;);&nbsp;//&nbsp;returns&nbsp;false&nbsp;(as&nbsp;of&nbsp;JS&nbsp;1.8.1/FF3.6)</span></span></span></div><div class="line"><a name="line217"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.propertyIsEnumerable(&#39;constructor&#39;);&nbsp;//&nbsp;returns&nbsp;false</span></span></span></div><div class="line"><a name="line218"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.propertyIsEnumerable(&#39;firstMethod&#39;);&nbsp;//&nbsp;returns&nbsp;false</span></span></span></div><div class="line"><a name="line219"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line220"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>prop</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;name&nbsp;of&nbsp;the&nbsp;property&nbsp;to&nbsp;test.</span></span></span></span></span></div><div class="line"><a name="line221"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Boolean}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>If</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>the&nbsp;object&nbsp;does&nbsp;not&nbsp;have&nbsp;the&nbsp;specified&nbsp;property,&nbsp;this</span></span></span></span></span></div><div class="line"><a name="line222"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;method&nbsp;returns&nbsp;false.</span></span></span></div><div class="line"><a name="line223"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line224"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line225"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line226"><a name="Object-method-toLocaleString"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;toLocaleString</span></span></span></div><div class="line"><a name="line227"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;a&nbsp;string&nbsp;representing&nbsp;the&nbsp;object.&nbsp;This&nbsp;method&nbsp;is&nbsp;meant&nbsp;to&nbsp;be&nbsp;overridden&nbsp;by&nbsp;derived&nbsp;objects</span></span></span></div><div class="line"><a name="line228"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;for&nbsp;locale-specific&nbsp;purposes.</span></span></span></div><div class="line"><a name="line229"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line230"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;`Object`&#39;s&nbsp;`toLocaleString`&nbsp;returns&nbsp;the&nbsp;result&nbsp;of&nbsp;calling&nbsp;`toString`.</span></span></span></div><div class="line"><a name="line231"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line232"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;function&nbsp;is&nbsp;provided&nbsp;to&nbsp;give&nbsp;objects&nbsp;a&nbsp;generic&nbsp;`toLocaleString`&nbsp;method,&nbsp;even&nbsp;though&nbsp;not&nbsp;all</span></span></span></div><div class="line"><a name="line233"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;may&nbsp;use&nbsp;it.&nbsp;Currently,&nbsp;only&nbsp;`Array`,&nbsp;`Number`,&nbsp;and&nbsp;`Date`&nbsp;override&nbsp;`toLocaleString`.</span></span></span></div><div class="line"><a name="line234"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line235"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>Object</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>represented&nbsp;as&nbsp;a&nbsp;string.</span></span></span></span></span></div><div class="line"><a name="line236"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line237"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line238"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line239"><a name="Object-method-toString"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;toString</span></span></span></div><div class="line"><a name="line240"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;a&nbsp;string&nbsp;representation&nbsp;of&nbsp;the&nbsp;object.</span></span></span></div><div class="line"><a name="line241"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line242"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Every&nbsp;object&nbsp;has&nbsp;a&nbsp;`toString()`&nbsp;method&nbsp;that&nbsp;is&nbsp;automatically&nbsp;called&nbsp;when&nbsp;the&nbsp;object&nbsp;is&nbsp;to&nbsp;be</span></span></span></div><div class="line"><a name="line243"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;represented&nbsp;as&nbsp;a&nbsp;text&nbsp;value&nbsp;or&nbsp;when&nbsp;an&nbsp;object&nbsp;is&nbsp;referred&nbsp;to&nbsp;in&nbsp;a&nbsp;manner&nbsp;in&nbsp;which&nbsp;a&nbsp;string&nbsp;is</span></span></span></div><div class="line"><a name="line244"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;expected.&nbsp;By&nbsp;default,&nbsp;the&nbsp;`toString()`&nbsp;method&nbsp;is&nbsp;inherited&nbsp;by&nbsp;every&nbsp;object&nbsp;descended&nbsp;from&nbsp;`Object`.</span></span></span></div><div class="line"><a name="line245"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;If&nbsp;this&nbsp;method&nbsp;is&nbsp;not&nbsp;overridden&nbsp;in&nbsp;a&nbsp;custom&nbsp;object,&nbsp;`toString()`&nbsp;returns&nbsp;&quot;[object&nbsp;type]&quot;,&nbsp;where</span></span></span></div><div class="line"><a name="line246"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;`type`&nbsp;is&nbsp;the&nbsp;object&nbsp;type.&nbsp;The&nbsp;following&nbsp;code&nbsp;illustrates&nbsp;this:</span></span></span></div><div class="line"><a name="line247"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line248"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;o&nbsp;=&nbsp;new&nbsp;Object();</span></span></span></div><div class="line"><a name="line249"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.toString();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;returns&nbsp;[object&nbsp;Object]</span></span></span></div><div class="line"><a name="line250"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line251"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;You&nbsp;can&nbsp;create&nbsp;a&nbsp;function&nbsp;to&nbsp;be&nbsp;called&nbsp;in&nbsp;place&nbsp;of&nbsp;the&nbsp;default&nbsp;`toString()`&nbsp;method.&nbsp;The</span></span></span></div><div class="line"><a name="line252"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;`toString()`&nbsp;method&nbsp;takes&nbsp;no&nbsp;arguments&nbsp;and&nbsp;should&nbsp;return&nbsp;a&nbsp;string.&nbsp;The&nbsp;`toString()`&nbsp;method&nbsp;you</span></span></span></div><div class="line"><a name="line253"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;create&nbsp;can&nbsp;be&nbsp;any&nbsp;value&nbsp;you&nbsp;want,&nbsp;but&nbsp;it&nbsp;will&nbsp;be&nbsp;most&nbsp;useful&nbsp;if&nbsp;it&nbsp;carries&nbsp;information&nbsp;about&nbsp;the</span></span></span></div><div class="line"><a name="line254"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;object.</span></span></span></div><div class="line"><a name="line255"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line256"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;code&nbsp;defines&nbsp;the&nbsp;`Dog`&nbsp;object&nbsp;type&nbsp;and&nbsp;creates&nbsp;`theDog`,&nbsp;an&nbsp;object&nbsp;of&nbsp;type&nbsp;`Dog`:</span></span></span></div><div class="line"><a name="line257"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line258"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Dog(name,breed,color,sex)&nbsp;{</span></span></span></div><div class="line"><a name="line259"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.name=name;</span></span></span></div><div class="line"><a name="line260"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.breed=breed;</span></span></span></div><div class="line"><a name="line261"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.color=color;</span></span></span></div><div class="line"><a name="line262"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.sex=sex;</span></span></span></div><div class="line"><a name="line263"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line264"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line265"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theDog&nbsp;=&nbsp;new&nbsp;Dog(&quot;Gabby&quot;,&quot;Lab&quot;,&quot;chocolate&quot;,&quot;female&quot;);</span></span></span></div><div class="line"><a name="line266"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line267"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;If&nbsp;you&nbsp;call&nbsp;the&nbsp;`toString()`&nbsp;method&nbsp;on&nbsp;this&nbsp;custom&nbsp;object,&nbsp;it&nbsp;returns&nbsp;the&nbsp;default&nbsp;value&nbsp;inherited</span></span></span></div><div class="line"><a name="line268"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;from&nbsp;`Object`:</span></span></span></div><div class="line"><a name="line269"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line270"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theDog.toString();&nbsp;//returns&nbsp;[object&nbsp;Object]</span></span></span></div><div class="line"><a name="line271"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line272"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;code&nbsp;creates&nbsp;and&nbsp;assigns&nbsp;`dogToString()`&nbsp;to&nbsp;override&nbsp;the&nbsp;default&nbsp;`toString()`&nbsp;method.</span></span></span></div><div class="line"><a name="line273"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;function&nbsp;generates&nbsp;a&nbsp;string&nbsp;containing&nbsp;the&nbsp;name,&nbsp;breed,&nbsp;color,&nbsp;and&nbsp;sex&nbsp;of&nbsp;the&nbsp;object,&nbsp;in&nbsp;the</span></span></span></div><div class="line"><a name="line274"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;form&nbsp;`&quot;property&nbsp;=&nbsp;value;&quot;`.</span></span></span></div><div class="line"><a name="line275"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line276"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dog.prototype.toString&nbsp;=&nbsp;function&nbsp;dogToString()&nbsp;{</span></span></span></div><div class="line"><a name="line277"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;ret&nbsp;=&nbsp;&quot;Dog&nbsp;&quot;&nbsp;+&nbsp;this.name&nbsp;+&nbsp;&quot;&nbsp;is&nbsp;a&nbsp;&quot;&nbsp;+&nbsp;this.sex&nbsp;+&nbsp;&quot;&nbsp;&quot;&nbsp;+&nbsp;this.color&nbsp;+&nbsp;&quot;&nbsp;&quot;&nbsp;+&nbsp;this.breed;</span></span></span></div><div class="line"><a name="line278"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;ret;</span></span></span></div><div class="line"><a name="line279"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line280"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line281"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;With&nbsp;the&nbsp;preceding&nbsp;code&nbsp;in&nbsp;place,&nbsp;any&nbsp;time&nbsp;theDog&nbsp;is&nbsp;used&nbsp;in&nbsp;a&nbsp;string&nbsp;context,&nbsp;JavaScript</span></span></span></div><div class="line"><a name="line282"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;automatically&nbsp;calls&nbsp;the&nbsp;`dogToString()`&nbsp;function,&nbsp;which&nbsp;returns&nbsp;the&nbsp;following&nbsp;string:</span></span></span></div><div class="line"><a name="line283"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line284"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dog&nbsp;Gabby&nbsp;is&nbsp;a&nbsp;female&nbsp;chocolate&nbsp;Lab</span></span></span></div><div class="line"><a name="line285"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line286"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;`toString()`&nbsp;can&nbsp;be&nbsp;used&nbsp;with&nbsp;every&nbsp;object&nbsp;and&nbsp;allows&nbsp;you&nbsp;to&nbsp;get&nbsp;its&nbsp;class.&nbsp;To&nbsp;use&nbsp;the</span></span></span></div><div class="line"><a name="line287"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;`Object.prototype.toString()`&nbsp;with&nbsp;every&nbsp;object,&nbsp;you&nbsp;need&nbsp;to&nbsp;call&nbsp;`Function.prototype.call()`&nbsp;or</span></span></span></div><div class="line"><a name="line288"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;`Function.prototype.apply()`&nbsp;on&nbsp;it,&nbsp;passing&nbsp;the&nbsp;object&nbsp;you&nbsp;want&nbsp;to&nbsp;inspect&nbsp;as&nbsp;the&nbsp;first&nbsp;parameter</span></span></span></div><div class="line"><a name="line289"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;called&nbsp;`thisArg`.</span></span></span></div><div class="line"><a name="line290"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line291"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;toString&nbsp;=&nbsp;Object.prototype.toString;</span></span></span></div><div class="line"><a name="line292"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line293"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toString.call(new&nbsp;Date);&nbsp;//&nbsp;[object&nbsp;Date]</span></span></span></div><div class="line"><a name="line294"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toString.call(new&nbsp;String);&nbsp;//&nbsp;[object&nbsp;String]</span></span></span></div><div class="line"><a name="line295"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toString.call(Math);&nbsp;//&nbsp;[object&nbsp;Math]</span></span></span></div><div class="line"><a name="line296"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line297"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>Object</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>represented&nbsp;as&nbsp;a&nbsp;string.</span></span></span></span></span></div><div class="line"><a name="line298"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line299"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line300"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line301"><a name="Object-method-valueOf"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;valueOf</span></span></span></div><div class="line"><a name="line302"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;the&nbsp;primitive&nbsp;value&nbsp;of&nbsp;the&nbsp;specified&nbsp;object.</span></span></span></div><div class="line"><a name="line303"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line304"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;JavaScript&nbsp;calls&nbsp;the&nbsp;`valueOf`&nbsp;method&nbsp;to&nbsp;convert&nbsp;an&nbsp;object&nbsp;to&nbsp;a&nbsp;primitive&nbsp;value.&nbsp;You&nbsp;rarely&nbsp;need&nbsp;to</span></span></span></div><div class="line"><a name="line305"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;invoke&nbsp;the&nbsp;`valueOf`&nbsp;method&nbsp;yourself;&nbsp;JavaScript&nbsp;automatically&nbsp;invokes&nbsp;it&nbsp;when&nbsp;encountering&nbsp;an</span></span></span></div><div class="line"><a name="line306"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;object&nbsp;where&nbsp;a&nbsp;primitive&nbsp;value&nbsp;is&nbsp;expected.</span></span></span></div><div class="line"><a name="line307"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line308"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;By&nbsp;default,&nbsp;the&nbsp;`valueOf`&nbsp;method&nbsp;is&nbsp;inherited&nbsp;by&nbsp;every&nbsp;object&nbsp;descended&nbsp;from&nbsp;`Object`.&nbsp;Every&nbsp;built-</span></span></span></div><div class="line"><a name="line309"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;in&nbsp;core&nbsp;object&nbsp;overrides&nbsp;this&nbsp;method&nbsp;to&nbsp;return&nbsp;an&nbsp;appropriate&nbsp;value.&nbsp;If&nbsp;an&nbsp;object&nbsp;has&nbsp;no&nbsp;primitive</span></span></span></div><div class="line"><a name="line310"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;value,&nbsp;`valueOf`&nbsp;returns&nbsp;the&nbsp;object&nbsp;itself,&nbsp;which&nbsp;is&nbsp;displayed&nbsp;as:</span></span></span></div><div class="line"><a name="line311"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line312"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[object&nbsp;Object]</span></span></span></div><div class="line"><a name="line313"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line314"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;You&nbsp;can&nbsp;use&nbsp;`valueOf`&nbsp;within&nbsp;your&nbsp;own&nbsp;code&nbsp;to&nbsp;convert&nbsp;a&nbsp;built-in&nbsp;object&nbsp;into&nbsp;a&nbsp;primitive&nbsp;value.</span></span></span></div><div class="line"><a name="line315"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;When&nbsp;you&nbsp;create&nbsp;a&nbsp;custom&nbsp;object,&nbsp;you&nbsp;can&nbsp;override&nbsp;`Object.valueOf`&nbsp;to&nbsp;call&nbsp;a&nbsp;custom&nbsp;method&nbsp;instead</span></span></span></div><div class="line"><a name="line316"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;of&nbsp;the&nbsp;default&nbsp;`Object`&nbsp;method.</span></span></span></div><div class="line"><a name="line317"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line318"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;You&nbsp;can&nbsp;create&nbsp;a&nbsp;function&nbsp;to&nbsp;be&nbsp;called&nbsp;in&nbsp;place&nbsp;of&nbsp;the&nbsp;default&nbsp;`valueOf`&nbsp;method.&nbsp;Your&nbsp;function&nbsp;must</span></span></span></div><div class="line"><a name="line319"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;take&nbsp;no&nbsp;arguments.</span></span></span></div><div class="line"><a name="line320"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line321"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Suppose&nbsp;you&nbsp;have&nbsp;an&nbsp;object&nbsp;type&nbsp;`myNumberType`&nbsp;and&nbsp;you&nbsp;want&nbsp;to&nbsp;create&nbsp;a&nbsp;`valueOf`&nbsp;method&nbsp;for&nbsp;it.</span></span></span></div><div class="line"><a name="line322"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;code&nbsp;assigns&nbsp;a&nbsp;user-defined&nbsp;function&nbsp;to&nbsp;the&nbsp;object&#39;s&nbsp;valueOf&nbsp;method:</span></span></span></div><div class="line"><a name="line323"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line324"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myNumberType.prototype.valueOf&nbsp;=&nbsp;new&nbsp;Function(functionText)</span></span></span></div><div class="line"><a name="line325"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line326"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;With&nbsp;the&nbsp;preceding&nbsp;code&nbsp;in&nbsp;place,&nbsp;any&nbsp;time&nbsp;an&nbsp;object&nbsp;of&nbsp;type&nbsp;`myNumberType`&nbsp;is&nbsp;used&nbsp;in&nbsp;a&nbsp;context</span></span></span></div><div class="line"><a name="line327"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;where&nbsp;it&nbsp;is&nbsp;to&nbsp;be&nbsp;represented&nbsp;as&nbsp;a&nbsp;primitive&nbsp;value,&nbsp;JavaScript&nbsp;automatically&nbsp;calls&nbsp;the&nbsp;function</span></span></span></div><div class="line"><a name="line328"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;defined&nbsp;in&nbsp;the&nbsp;preceding&nbsp;code.</span></span></span></div><div class="line"><a name="line329"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line330"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;An&nbsp;object&#39;s&nbsp;`valueOf`&nbsp;method&nbsp;is&nbsp;usually&nbsp;invoked&nbsp;by&nbsp;JavaScript,&nbsp;but&nbsp;you&nbsp;can&nbsp;invoke&nbsp;it&nbsp;yourself&nbsp;as</span></span></span></div><div class="line"><a name="line331"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;follows:</span></span></span></div><div class="line"><a name="line332"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line333"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myNumber.valueOf()</span></span></span></div><div class="line"><a name="line334"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line335"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Note:&nbsp;Objects&nbsp;in&nbsp;string&nbsp;contexts&nbsp;convert&nbsp;via&nbsp;the&nbsp;`toString`&nbsp;method,&nbsp;which&nbsp;is&nbsp;different&nbsp;from</span></span></span></div><div class="line"><a name="line336"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;`String`&nbsp;objects&nbsp;converting&nbsp;to&nbsp;string&nbsp;primitives&nbsp;using&nbsp;`valueOf`.&nbsp;All&nbsp;objects&nbsp;have&nbsp;a&nbsp;string</span></span></span></div><div class="line"><a name="line337"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;conversion,&nbsp;if&nbsp;only&nbsp;`&quot;[object&nbsp;type]&quot;`.&nbsp;But&nbsp;many&nbsp;objects&nbsp;do&nbsp;not&nbsp;convert&nbsp;to&nbsp;number,&nbsp;boolean,&nbsp;or</span></span></span></div><div class="line"><a name="line338"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;function.</span></span></span></div><div class="line"><a name="line339"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line340"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>Returns</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>value&nbsp;of&nbsp;the&nbsp;object&nbsp;or&nbsp;the&nbsp;object&nbsp;itself.</span></span></span></span></span></div><div class="line"><a name="line341"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line342"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line343"><span class="source js"><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>Properties</span><span>&nbsp;</span></span></span></div><div class="line"><a name="line344"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line345"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line346"><a name="Object-property-constructor"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@property</span></span><span>&nbsp;constructor</span></span></span></div><div class="line"><a name="line347"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Specifies&nbsp;the&nbsp;function&nbsp;that&nbsp;creates&nbsp;an&nbsp;object&#39;s&nbsp;prototype.</span></span></span></div><div class="line"><a name="line348"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line349"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;a&nbsp;reference&nbsp;to&nbsp;the&nbsp;Object&nbsp;function&nbsp;that&nbsp;created&nbsp;the&nbsp;instance&#39;s&nbsp;prototype.&nbsp;Note&nbsp;that&nbsp;the</span></span></span></div><div class="line"><a name="line350"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;value&nbsp;of&nbsp;this&nbsp;property&nbsp;is&nbsp;a&nbsp;reference&nbsp;to&nbsp;the&nbsp;function&nbsp;itself,&nbsp;not&nbsp;a&nbsp;string&nbsp;containing&nbsp;the</span></span></span></div><div class="line"><a name="line351"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;function&#39;s&nbsp;name,&nbsp;but&nbsp;it&nbsp;isn&#39;t&nbsp;read&nbsp;only&nbsp;(except&nbsp;for&nbsp;primitive&nbsp;Boolean,&nbsp;Number&nbsp;or&nbsp;String&nbsp;values:&nbsp;1,</span></span></span></div><div class="line"><a name="line352"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;true,&nbsp;&quot;read-only&quot;).</span></span></span></div><div class="line"><a name="line353"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line354"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;All&nbsp;objects&nbsp;inherit&nbsp;a&nbsp;`constructor`&nbsp;property&nbsp;from&nbsp;their&nbsp;`prototype`:</span></span></span></div><div class="line"><a name="line355"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line356"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;new&nbsp;Object&nbsp;//&nbsp;or&nbsp;o&nbsp;=&nbsp;{}&nbsp;in&nbsp;JavaScript&nbsp;1.2</span></span></span></div><div class="line"><a name="line357"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.constructor&nbsp;==&nbsp;Object</span></span></span></div><div class="line"><a name="line358"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;=&nbsp;new&nbsp;Array&nbsp;//&nbsp;or&nbsp;a&nbsp;=&nbsp;[]&nbsp;in&nbsp;JavaScript&nbsp;1.2</span></span></span></div><div class="line"><a name="line359"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.constructor&nbsp;==&nbsp;Array</span></span></span></div><div class="line"><a name="line360"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n&nbsp;=&nbsp;new&nbsp;Number(3)</span></span></span></div><div class="line"><a name="line361"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;n.constructor&nbsp;==&nbsp;Number</span></span></span></div><div class="line"><a name="line362"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line363"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Even&nbsp;though&nbsp;you&nbsp;cannot&nbsp;construct&nbsp;most&nbsp;HTML&nbsp;objects,&nbsp;you&nbsp;can&nbsp;do&nbsp;comparisons.&nbsp;For&nbsp;example,</span></span></span></div><div class="line"><a name="line364"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line365"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.constructor&nbsp;==&nbsp;Document</span></span></span></div><div class="line"><a name="line366"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.form3.constructor&nbsp;==&nbsp;Form</span></span></span></div><div class="line"><a name="line367"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line368"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;example&nbsp;creates&nbsp;a&nbsp;prototype,&nbsp;`Tree`,&nbsp;and&nbsp;an&nbsp;object&nbsp;of&nbsp;that&nbsp;type,&nbsp;theTree.&nbsp;The&nbsp;example&nbsp;then&nbsp;displays&nbsp;the&nbsp;`constructor`&nbsp;property&nbsp;for&nbsp;the&nbsp;object&nbsp;`theTree`.</span></span></span></div><div class="line"><a name="line369"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line370"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Tree(name)&nbsp;{</span></span></span></div><div class="line"><a name="line371"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.name&nbsp;=&nbsp;name;</span></span></span></div><div class="line"><a name="line372"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line373"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theTree&nbsp;=&nbsp;new&nbsp;Tree(&quot;Redwood&quot;);</span></span></span></div><div class="line"><a name="line374"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(&quot;theTree.constructor&nbsp;is&nbsp;&quot;&nbsp;+&nbsp;theTree.constructor);</span></span></span></div><div class="line"><a name="line375"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line376"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;example&nbsp;displays&nbsp;the&nbsp;following&nbsp;output:</span></span></span></div><div class="line"><a name="line377"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line378"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theTree.constructor&nbsp;is&nbsp;function&nbsp;Tree(name)&nbsp;{</span></span></span></div><div class="line"><a name="line379"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.name&nbsp;=&nbsp;name;</span></span></span></div><div class="line"><a name="line380"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line381"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line382"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;example&nbsp;shows&nbsp;how&nbsp;to&nbsp;modify&nbsp;constructor&nbsp;value&nbsp;of&nbsp;generic&nbsp;objects.&nbsp;Only&nbsp;true,&nbsp;1&nbsp;and</span></span></span></div><div class="line"><a name="line383"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&quot;test&quot;&nbsp;variable&nbsp;constructors&nbsp;will&nbsp;not&nbsp;be&nbsp;changed.&nbsp;This&nbsp;example&nbsp;explains&nbsp;that&nbsp;is&nbsp;not&nbsp;always&nbsp;so&nbsp;safe</span></span></span></div><div class="line"><a name="line384"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;to&nbsp;believe&nbsp;in&nbsp;constructor&nbsp;function.</span></span></span></div><div class="line"><a name="line385"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line386"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Type(){};</span></span></span></div><div class="line"><a name="line387"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var	types&nbsp;=&nbsp;[</span></span></span></div><div class="line"><a name="line388"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;	&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;Array,	[],</span></span></span></div><div class="line"><a name="line389"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*	&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;Boolean,	true,</span></span></span></div><div class="line"><a name="line390"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*	&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;Date,</span></span></span></div><div class="line"><a name="line391"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*	&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;Error,</span></span></span></div><div class="line"><a name="line392"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*	&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;Function,	function(){},</span></span></span></div><div class="line"><a name="line393"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*	&nbsp;&nbsp;&nbsp;&nbsp;Math,</span></span></span></div><div class="line"><a name="line394"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*	&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;Number,	1,</span></span></span></div><div class="line"><a name="line395"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*	&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;Object,	{},</span></span></span></div><div class="line"><a name="line396"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*	&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;RegExp,	/(?:)/,</span></span></span></div><div class="line"><a name="line397"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*	&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;String,	&quot;test&quot;</span></span></span></div><div class="line"><a name="line398"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;];</span></span></span></div><div class="line"><a name="line399"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(var&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;types.length;&nbsp;i++){</span></span></span></div><div class="line"><a name="line400"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;types[i].constructor&nbsp;=&nbsp;Type;</span></span></span></div><div class="line"><a name="line401"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;types[i]&nbsp;=&nbsp;[types[i].constructor,&nbsp;types[i]&nbsp;instanceof&nbsp;Type,&nbsp;types[i].toString()];</span></span></span></div><div class="line"><a name="line402"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></span></span></div><div class="line"><a name="line403"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(types.join(&quot;\n&quot;));</span></span></span></div><div class="line"><a name="line404"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line405"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line406"><span class="source js"><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;ECMAScript&nbsp;5&nbsp;methods</span><span>&nbsp;</span></span></span></div><div class="line"><a name="line407"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line408"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line409"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;create</span></span></span></div><div class="line"><a name="line410"><a name="Object-static-method-create"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line411"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Creates&nbsp;a&nbsp;new&nbsp;object&nbsp;with&nbsp;the&nbsp;specified&nbsp;prototype&nbsp;object&nbsp;and&nbsp;properties.</span></span></span></div><div class="line"><a name="line412"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line413"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;##&nbsp;Classical&nbsp;inheritance&nbsp;with&nbsp;Object.create</span></span></span></div><div class="line"><a name="line414"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line415"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Below&nbsp;is&nbsp;an&nbsp;example&nbsp;of&nbsp;how&nbsp;to&nbsp;use&nbsp;`Object.create`&nbsp;to&nbsp;achieve</span></span></span></div><div class="line"><a name="line416"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;classical&nbsp;inheritance,&nbsp;this&nbsp;is&nbsp;for&nbsp;single&nbsp;inheritance,&nbsp;which&nbsp;is&nbsp;all</span></span></span></div><div class="line"><a name="line417"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;that&nbsp;Javascript&nbsp;supports.</span></span></span></div><div class="line"><a name="line418"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line419"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//Shape&nbsp;-&nbsp;superclass</span></span></span></div><div class="line"><a name="line420"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Shape()&nbsp;{</span></span></span></div><div class="line"><a name="line421"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.x&nbsp;=&nbsp;0;</span></span></span></div><div class="line"><a name="line422"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.y&nbsp;=&nbsp;0;</span></span></span></div><div class="line"><a name="line423"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line424"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line425"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shape.prototype.move&nbsp;=&nbsp;function(x,&nbsp;y)&nbsp;{</span></span></span></div><div class="line"><a name="line426"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.x&nbsp;+=&nbsp;x;</span></span></span></div><div class="line"><a name="line427"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.y&nbsp;+=&nbsp;y;</span></span></span></div><div class="line"><a name="line428"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.info(&quot;Shape&nbsp;moved.&quot;);</span></span></span></div><div class="line"><a name="line429"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></span></span></div><div class="line"><a name="line430"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line431"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Rectangle&nbsp;-&nbsp;subclass</span></span></span></div><div class="line"><a name="line432"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Rectangle()&nbsp;{</span></span></span></div><div class="line"><a name="line433"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shape.call(this);&nbsp;//call&nbsp;super&nbsp;constructor.</span></span></span></div><div class="line"><a name="line434"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line435"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line436"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rectangle.prototype&nbsp;=&nbsp;Object.create(Shape.prototype);</span></span></span></div><div class="line"><a name="line437"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line438"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;rect&nbsp;=&nbsp;new&nbsp;Rectangle();</span></span></span></div><div class="line"><a name="line439"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line440"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rect&nbsp;instanceof&nbsp;Rectangle&nbsp;//true.</span></span></span></div><div class="line"><a name="line441"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rect&nbsp;instanceof&nbsp;Shape&nbsp;//true.</span></span></span></div><div class="line"><a name="line442"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line443"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rect.move();&nbsp;//Outputs,&nbsp;&quot;Shape&nbsp;moved.&quot;</span></span></span></div><div class="line"><a name="line444"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line445"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;If&nbsp;you&nbsp;wish&nbsp;to&nbsp;inherit&nbsp;from&nbsp;multiple&nbsp;objects,&nbsp;then&nbsp;mixins&nbsp;are&nbsp;a&nbsp;possibility.</span></span></span></div><div class="line"><a name="line446"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line447"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;MyClass()&nbsp;{</span></span></span></div><div class="line"><a name="line448"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SuperClass.call(this);</span></span></span></div><div class="line"><a name="line449"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OtherSuperClass.call(this);</span></span></span></div><div class="line"><a name="line450"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line451"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line452"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MyClass.prototype&nbsp;=&nbsp;Object.create(SuperClass.prototype);&nbsp;//inherit</span></span></span></div><div class="line"><a name="line453"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mixin(MyClass.prototype,&nbsp;OtherSuperClass.prototype);&nbsp;//mixin</span></span></span></div><div class="line"><a name="line454"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line455"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MyClass.prototype.myMethod&nbsp;=&nbsp;function()&nbsp;{</span></span></span></div><div class="line"><a name="line456"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;do&nbsp;a&nbsp;thing</span></span></span></div><div class="line"><a name="line457"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></span></span></div><div class="line"><a name="line458"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line459"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;mixin&nbsp;function&nbsp;would&nbsp;copy&nbsp;the&nbsp;functions&nbsp;from&nbsp;the&nbsp;superclass</span></span></span></div><div class="line"><a name="line460"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;prototype&nbsp;to&nbsp;the&nbsp;subclass&nbsp;prototype,&nbsp;the&nbsp;mixin&nbsp;function&nbsp;needs&nbsp;to&nbsp;be</span></span></span></div><div class="line"><a name="line461"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;supplied&nbsp;by&nbsp;the&nbsp;user.</span></span></span></div><div class="line"><a name="line462"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line463"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;##&nbsp;Using&nbsp;`propertiesObject`&nbsp;argument&nbsp;with&nbsp;Object.create</span></span></span></div><div class="line"><a name="line464"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line465"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;o;</span></span></span></div><div class="line"><a name="line466"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line467"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;create&nbsp;an&nbsp;object&nbsp;with&nbsp;null&nbsp;as&nbsp;prototype</span></span></span></div><div class="line"><a name="line468"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;Object.create(null);</span></span></span></div><div class="line"><a name="line469"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line470"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line471"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;{};</span></span></span></div><div class="line"><a name="line472"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;is&nbsp;equivalent&nbsp;to:</span></span></span></div><div class="line"><a name="line473"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;Object.create(Object.prototype);</span></span></span></div><div class="line"><a name="line474"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line475"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line476"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Example&nbsp;where&nbsp;we&nbsp;create&nbsp;an&nbsp;object&nbsp;with&nbsp;a&nbsp;couple&nbsp;of&nbsp;sample&nbsp;properties.</span></span></span></div><div class="line"><a name="line477"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;(Note&nbsp;that&nbsp;the&nbsp;second&nbsp;parameter&nbsp;maps&nbsp;keys&nbsp;to&nbsp;*property&nbsp;descriptors*.)</span></span></span></div><div class="line"><a name="line478"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;Object.create(Object.prototype,&nbsp;{</span></span></span></div><div class="line"><a name="line479"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;foo&nbsp;is&nbsp;a&nbsp;regular&nbsp;&quot;value&nbsp;property&quot;</span></span></span></div><div class="line"><a name="line480"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foo:&nbsp;{&nbsp;writable:true,&nbsp;configurable:true,&nbsp;value:&nbsp;&quot;hello&quot;&nbsp;},</span></span></span></div><div class="line"><a name="line481"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;bar&nbsp;is&nbsp;a&nbsp;getter-and-setter&nbsp;(accessor)&nbsp;property</span></span></span></div><div class="line"><a name="line482"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bar:&nbsp;{</span></span></span></div><div class="line"><a name="line483"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;configurable:&nbsp;false,</span></span></span></div><div class="line"><a name="line484"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get:&nbsp;function()&nbsp;{&nbsp;return&nbsp;10&nbsp;},</span></span></span></div><div class="line"><a name="line485"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set:&nbsp;function(value)&nbsp;{&nbsp;console.log(&quot;Setting&nbsp;`o.bar`&nbsp;to&quot;,&nbsp;value)&nbsp;}</span></span></span></div><div class="line"><a name="line486"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}})</span></span></span></div><div class="line"><a name="line487"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line488"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line489"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;Constructor(){}</span></span></span></div><div class="line"><a name="line490"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;new&nbsp;Constructor();</span></span></span></div><div class="line"><a name="line491"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;is&nbsp;equivalent&nbsp;to:</span></span></span></div><div class="line"><a name="line492"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;Object.create(Constructor.prototype);</span></span></span></div><div class="line"><a name="line493"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Of&nbsp;course,&nbsp;if&nbsp;there&nbsp;is&nbsp;actual&nbsp;initialization&nbsp;code&nbsp;in&nbsp;the&nbsp;Constructor&nbsp;function,&nbsp;the&nbsp;Object.create&nbsp;cannot&nbsp;reflect&nbsp;it</span></span></span></div><div class="line"><a name="line494"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line495"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line496"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;create&nbsp;a&nbsp;new&nbsp;object&nbsp;whose&nbsp;prototype&nbsp;is&nbsp;a&nbsp;new,&nbsp;empty&nbsp;object</span></span></span></div><div class="line"><a name="line497"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;and&nbsp;a&nbsp;adding&nbsp;single&nbsp;property&nbsp;&#39;p&#39;,&nbsp;with&nbsp;value&nbsp;42</span></span></span></div><div class="line"><a name="line498"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;Object.create({},&nbsp;{&nbsp;p:&nbsp;{&nbsp;value:&nbsp;42&nbsp;}&nbsp;})</span></span></span></div><div class="line"><a name="line499"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line500"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;by&nbsp;default&nbsp;properties&nbsp;ARE&nbsp;NOT&nbsp;writable,&nbsp;enumerable&nbsp;or&nbsp;configurable:</span></span></span></div><div class="line"><a name="line501"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.p&nbsp;=&nbsp;24</span></span></span></div><div class="line"><a name="line502"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.p</span></span></span></div><div class="line"><a name="line503"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//42</span></span></span></div><div class="line"><a name="line504"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line505"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o.q&nbsp;=&nbsp;12</span></span></span></div><div class="line"><a name="line506"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;(var&nbsp;prop&nbsp;in&nbsp;o)&nbsp;{</span></span></span></div><div class="line"><a name="line507"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log(prop)</span></span></span></div><div class="line"><a name="line508"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line509"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&quot;q&quot;</span></span></span></div><div class="line"><a name="line510"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line511"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete&nbsp;o.p</span></span></span></div><div class="line"><a name="line512"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//false</span></span></span></div><div class="line"><a name="line513"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line514"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//to&nbsp;specify&nbsp;an&nbsp;ES3&nbsp;property</span></span></span></div><div class="line"><a name="line515"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o2&nbsp;=&nbsp;Object.create({},&nbsp;{&nbsp;p:&nbsp;{&nbsp;value:&nbsp;42,&nbsp;writable:&nbsp;true,&nbsp;enumerable:&nbsp;true,&nbsp;configurable:&nbsp;true&nbsp;}&nbsp;});</span></span></span></div><div class="line"><a name="line516"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line517"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line518"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line519"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>proto</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;which&nbsp;should&nbsp;be&nbsp;the&nbsp;prototype&nbsp;of</span></span></span></span></span></div><div class="line"><a name="line520"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;the&nbsp;newly-created&nbsp;object.</span></span></span></div><div class="line"><a name="line521"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line522"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Throws&nbsp;a&nbsp;`TypeError`&nbsp;exception&nbsp;if&nbsp;the&nbsp;`proto`&nbsp;parameter&nbsp;isn&#39;t&nbsp;null&nbsp;or</span></span></span></div><div class="line"><a name="line523"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;an&nbsp;object.</span></span></span></div><div class="line"><a name="line524"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line525"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{Object}&nbsp;[propertiesObject]&nbsp;If&nbsp;specified&nbsp;and&nbsp;not&nbsp;undefined,</span></span></span></div><div class="line"><a name="line526"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;an&nbsp;object&nbsp;whose&nbsp;enumerable&nbsp;own&nbsp;properties&nbsp;(that&nbsp;is,&nbsp;those</span></span></span></div><div class="line"><a name="line527"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;properties&nbsp;defined&nbsp;upon&nbsp;itself&nbsp;and&nbsp;not&nbsp;enumerable&nbsp;properties&nbsp;along</span></span></span></div><div class="line"><a name="line528"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;its&nbsp;prototype&nbsp;chain)&nbsp;specify&nbsp;property&nbsp;descriptors&nbsp;to&nbsp;be&nbsp;added&nbsp;to</span></span></span></div><div class="line"><a name="line529"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;the&nbsp;newly-created&nbsp;object,&nbsp;with&nbsp;the&nbsp;corresponding&nbsp;property&nbsp;names.</span></span></span></div><div class="line"><a name="line530"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line531"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>the</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>newly&nbsp;created&nbsp;object.</span></span></span></span></span></div><div class="line"><a name="line532"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line533"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line534"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line535"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;defineProperty</span></span></span></div><div class="line"><a name="line536"><a name="Object-static-method-defineProperty"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line537"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line538"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Defines&nbsp;a&nbsp;new&nbsp;property&nbsp;directly&nbsp;on&nbsp;an&nbsp;object,&nbsp;or&nbsp;modifies&nbsp;an</span></span></span></div><div class="line"><a name="line539"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;existing&nbsp;property&nbsp;on&nbsp;an&nbsp;object,&nbsp;and&nbsp;returns&nbsp;the&nbsp;object.</span></span></span></div><div class="line"><a name="line540"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line541"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;method&nbsp;allows&nbsp;precise&nbsp;addition&nbsp;to&nbsp;or&nbsp;modification&nbsp;of&nbsp;a</span></span></span></div><div class="line"><a name="line542"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;property&nbsp;on&nbsp;an&nbsp;object.&nbsp;Normal&nbsp;property&nbsp;addition&nbsp;through&nbsp;assignment</span></span></span></div><div class="line"><a name="line543"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;creates&nbsp;properties&nbsp;which&nbsp;show&nbsp;up&nbsp;during&nbsp;property&nbsp;enumeration</span></span></span></div><div class="line"><a name="line544"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;(for...in&nbsp;loop&nbsp;or&nbsp;{@link&nbsp;Object#keys}&nbsp;method),&nbsp;whose&nbsp;values&nbsp;may&nbsp;be</span></span></span></div><div class="line"><a name="line545"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;changed,&nbsp;and&nbsp;which&nbsp;may&nbsp;be&nbsp;deleted.&nbsp;This&nbsp;method&nbsp;allows&nbsp;these&nbsp;extra</span></span></span></div><div class="line"><a name="line546"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;details&nbsp;to&nbsp;be&nbsp;changed&nbsp;from&nbsp;their&nbsp;defaults.</span></span></span></div><div class="line"><a name="line547"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line548"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Property&nbsp;descriptors&nbsp;present&nbsp;in&nbsp;objects&nbsp;come&nbsp;in&nbsp;two&nbsp;main&nbsp;flavors:</span></span></span></div><div class="line"><a name="line549"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;data&nbsp;descriptors&nbsp;and&nbsp;accessor&nbsp;descriptors.&nbsp;A&nbsp;data&nbsp;descriptor&nbsp;is&nbsp;a</span></span></span></div><div class="line"><a name="line550"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;property&nbsp;that&nbsp;has&nbsp;a&nbsp;value,&nbsp;which&nbsp;may&nbsp;or&nbsp;may&nbsp;not&nbsp;be&nbsp;writable.&nbsp;An</span></span></span></div><div class="line"><a name="line551"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;accessor&nbsp;descriptor&nbsp;is&nbsp;a&nbsp;property&nbsp;described&nbsp;by&nbsp;a&nbsp;getter-setter&nbsp;pair</span></span></span></div><div class="line"><a name="line552"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;of&nbsp;functions.&nbsp;A&nbsp;descriptor&nbsp;must&nbsp;be&nbsp;one&nbsp;of&nbsp;these&nbsp;two&nbsp;flavors;&nbsp;it</span></span></span></div><div class="line"><a name="line553"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;cannot&nbsp;be&nbsp;both.</span></span></span></div><div class="line"><a name="line554"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line555"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Both&nbsp;data&nbsp;and&nbsp;accessor&nbsp;descriptor&nbsp;is&nbsp;an&nbsp;object&nbsp;with&nbsp;the&nbsp;following</span></span></span></div><div class="line"><a name="line556"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;optional&nbsp;keys:</span></span></span></div><div class="line"><a name="line557"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line558"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**configurable**&nbsp;True&nbsp;if&nbsp;and&nbsp;only&nbsp;if&nbsp;the&nbsp;type&nbsp;of&nbsp;this&nbsp;property</span></span></span></div><div class="line"><a name="line559"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;descriptor&nbsp;may&nbsp;be&nbsp;changed&nbsp;and&nbsp;if&nbsp;the&nbsp;property&nbsp;may&nbsp;be&nbsp;deleted&nbsp;from</span></span></span></div><div class="line"><a name="line560"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;the&nbsp;corresponding&nbsp;object.&nbsp;Defaults&nbsp;to&nbsp;false.</span></span></span></div><div class="line"><a name="line561"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line562"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**enumerable**&nbsp;True&nbsp;if&nbsp;and&nbsp;only&nbsp;if&nbsp;this&nbsp;property&nbsp;shows&nbsp;up&nbsp;during</span></span></span></div><div class="line"><a name="line563"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;enumeration&nbsp;of&nbsp;the&nbsp;properties&nbsp;on&nbsp;the&nbsp;corresponding</span></span></span></div><div class="line"><a name="line564"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;object.&nbsp;Defaults&nbsp;to&nbsp;false.</span></span></span></div><div class="line"><a name="line565"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line566"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;A&nbsp;data&nbsp;descriptor&nbsp;is&nbsp;an&nbsp;object&nbsp;with&nbsp;the&nbsp;following&nbsp;optional&nbsp;keys:</span></span></span></div><div class="line"><a name="line567"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line568"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**value**&nbsp;The&nbsp;value&nbsp;associated&nbsp;with&nbsp;the&nbsp;property.&nbsp;Can&nbsp;be&nbsp;any</span></span></span></div><div class="line"><a name="line569"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;valid&nbsp;JavaScript&nbsp;value&nbsp;(number,&nbsp;object,&nbsp;function,&nbsp;etc)&nbsp;Defaults</span></span></span></div><div class="line"><a name="line570"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;to&nbsp;undefined.</span></span></span></div><div class="line"><a name="line571"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line572"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**writable**&nbsp;True&nbsp;if&nbsp;and&nbsp;only&nbsp;if&nbsp;the&nbsp;value&nbsp;associated&nbsp;with&nbsp;the</span></span></span></div><div class="line"><a name="line573"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;property&nbsp;may&nbsp;be&nbsp;changed&nbsp;with&nbsp;an&nbsp;assignment&nbsp;operator.&nbsp;Defaults&nbsp;to</span></span></span></div><div class="line"><a name="line574"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;false.</span></span></span></div><div class="line"><a name="line575"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line576"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;An&nbsp;accessor&nbsp;descriptor&nbsp;is&nbsp;an&nbsp;object&nbsp;with&nbsp;the&nbsp;following&nbsp;optional</span></span></span></div><div class="line"><a name="line577"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;keys:</span></span></span></div><div class="line"><a name="line578"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line579"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**get**&nbsp;A&nbsp;function&nbsp;which&nbsp;serves&nbsp;as&nbsp;a&nbsp;getter&nbsp;for&nbsp;the&nbsp;property,&nbsp;or</span></span></span></div><div class="line"><a name="line580"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;undefined&nbsp;if&nbsp;there&nbsp;is&nbsp;no&nbsp;getter.&nbsp;The&nbsp;function&nbsp;return&nbsp;will&nbsp;be&nbsp;used</span></span></span></div><div class="line"><a name="line581"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;as&nbsp;the&nbsp;value&nbsp;of&nbsp;property.&nbsp;Defaults&nbsp;to&nbsp;undefined.</span></span></span></div><div class="line"><a name="line582"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line583"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**set**&nbsp;A&nbsp;function&nbsp;which&nbsp;serves&nbsp;as&nbsp;a&nbsp;setter&nbsp;for&nbsp;the&nbsp;property,&nbsp;or</span></span></span></div><div class="line"><a name="line584"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;undefined&nbsp;if&nbsp;there&nbsp;is&nbsp;no&nbsp;setter.&nbsp;The&nbsp;function&nbsp;will&nbsp;receive&nbsp;as</span></span></span></div><div class="line"><a name="line585"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;only&nbsp;argument&nbsp;the&nbsp;new&nbsp;value&nbsp;being&nbsp;assigned&nbsp;to&nbsp;the</span></span></span></div><div class="line"><a name="line586"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;property.&nbsp;Defaults&nbsp;to&nbsp;undefined.</span></span></span></div><div class="line"><a name="line587"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line588"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Bear&nbsp;in&nbsp;mind&nbsp;that&nbsp;these&nbsp;options&nbsp;are&nbsp;not&nbsp;necessarily&nbsp;own&nbsp;properties</span></span></span></div><div class="line"><a name="line589"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;so,&nbsp;if&nbsp;inherited,&nbsp;will&nbsp;be&nbsp;considered&nbsp;too.&nbsp;In&nbsp;order&nbsp;to&nbsp;ensure&nbsp;these</span></span></span></div><div class="line"><a name="line590"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;defaults&nbsp;are&nbsp;preserved&nbsp;you&nbsp;might&nbsp;freeze&nbsp;the&nbsp;Object.prototype</span></span></span></div><div class="line"><a name="line591"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;upfront,&nbsp;specify&nbsp;all&nbsp;options&nbsp;explicitly,&nbsp;or&nbsp;point&nbsp;to&nbsp;null&nbsp;as</span></span></span></div><div class="line"><a name="line592"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;__proto__&nbsp;property.</span></span></span></div><div class="line"><a name="line593"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line594"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line595"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line596"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;on&nbsp;which&nbsp;to&nbsp;define&nbsp;the&nbsp;property.</span></span></span></span></span></div><div class="line"><a name="line597"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>prop</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;name&nbsp;of&nbsp;the&nbsp;property&nbsp;to&nbsp;be&nbsp;defined&nbsp;or&nbsp;modified.</span></span></span></span></span></div><div class="line"><a name="line598"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>descriptor</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;descriptor&nbsp;for&nbsp;the&nbsp;property&nbsp;being</span></span></span></span></span></div><div class="line"><a name="line599"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;defined&nbsp;or&nbsp;modified.</span></span></span></div><div class="line"><a name="line600"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line601"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line602"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line603"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;defineProperties</span></span></span></div><div class="line"><a name="line604"><a name="Object-static-method-defineProperties"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line605"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line606"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Defines&nbsp;new&nbsp;or&nbsp;modifies&nbsp;existing&nbsp;properties&nbsp;directly&nbsp;on&nbsp;an&nbsp;object,</span></span></span></div><div class="line"><a name="line607"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;returning&nbsp;the&nbsp;object.</span></span></span></div><div class="line"><a name="line608"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line609"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;In&nbsp;essence,&nbsp;it&nbsp;defines&nbsp;all&nbsp;properties&nbsp;corresponding&nbsp;to&nbsp;the</span></span></span></div><div class="line"><a name="line610"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;enumerable&nbsp;own&nbsp;properties&nbsp;of&nbsp;props&nbsp;on&nbsp;the&nbsp;object.</span></span></span></div><div class="line"><a name="line611"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line612"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.defineProperties(obj,&nbsp;{</span></span></span></div><div class="line"><a name="line613"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;property1&quot;:&nbsp;{</span></span></span></div><div class="line"><a name="line614"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value:&nbsp;true,</span></span></span></div><div class="line"><a name="line615"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writable:&nbsp;true</span></span></span></div><div class="line"><a name="line616"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},</span></span></span></div><div class="line"><a name="line617"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;property2&quot;:&nbsp;{</span></span></span></div><div class="line"><a name="line618"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value:&nbsp;&quot;Hello&quot;,</span></span></span></div><div class="line"><a name="line619"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writable:&nbsp;false</span></span></span></div><div class="line"><a name="line620"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line621"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;etc.&nbsp;etc.</span></span></span></div><div class="line"><a name="line622"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</span></span></span></div><div class="line"><a name="line623"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line624"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line625"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line626"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;on&nbsp;which&nbsp;to&nbsp;define&nbsp;or&nbsp;modify&nbsp;properties.</span></span></span></span></span></div><div class="line"><a name="line627"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>props</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>An&nbsp;object&nbsp;whose&nbsp;own&nbsp;enumerable&nbsp;properties</span></span></span></span></span></div><div class="line"><a name="line628"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;constitute&nbsp;descriptors&nbsp;for&nbsp;the&nbsp;properties&nbsp;to&nbsp;be&nbsp;defined&nbsp;or</span></span></span></div><div class="line"><a name="line629"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;modified.</span></span></span></div><div class="line"><a name="line630"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line631"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line632"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line633"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;getOwnPropertyDescriptor</span></span></span></div><div class="line"><a name="line634"><a name="Object-static-method-getOwnPropertyDescriptor"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line635"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line636"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;a&nbsp;property&nbsp;descriptor&nbsp;for&nbsp;an&nbsp;own&nbsp;property&nbsp;(that&nbsp;is,&nbsp;one</span></span></span></div><div class="line"><a name="line637"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;directly&nbsp;present&nbsp;on&nbsp;an&nbsp;object,&nbsp;not&nbsp;present&nbsp;by&nbsp;dint&nbsp;of&nbsp;being&nbsp;along</span></span></span></div><div class="line"><a name="line638"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;an&nbsp;object&#39;s&nbsp;prototype&nbsp;chain)&nbsp;of&nbsp;a&nbsp;given&nbsp;object.</span></span></span></div><div class="line"><a name="line639"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line640"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;method&nbsp;permits&nbsp;examination&nbsp;of&nbsp;the&nbsp;precise&nbsp;description&nbsp;of&nbsp;a</span></span></span></div><div class="line"><a name="line641"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;property.&nbsp;A&nbsp;property&nbsp;in&nbsp;JavaScript&nbsp;consists&nbsp;of&nbsp;a&nbsp;string-valued&nbsp;name</span></span></span></div><div class="line"><a name="line642"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;and&nbsp;a&nbsp;property&nbsp;descriptor.&nbsp;Further&nbsp;information&nbsp;about&nbsp;property</span></span></span></div><div class="line"><a name="line643"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;descriptor&nbsp;types&nbsp;and&nbsp;their&nbsp;attributes&nbsp;can&nbsp;be&nbsp;found&nbsp;in</span></span></span></div><div class="line"><a name="line644"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;{@link&nbsp;Object#defineProperty}.</span></span></span></div><div class="line"><a name="line645"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line646"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line647"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line648"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;in&nbsp;which&nbsp;to&nbsp;look&nbsp;for&nbsp;the&nbsp;property.</span></span></span></span></span></div><div class="line"><a name="line649"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{String}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>prop</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;name&nbsp;of&nbsp;the&nbsp;property&nbsp;whose&nbsp;description&nbsp;is</span></span></span></span></span></div><div class="line"><a name="line650"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;to&nbsp;be&nbsp;retrieved.</span></span></span></div><div class="line"><a name="line651"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line652"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;A&nbsp;property&nbsp;descriptor&nbsp;is&nbsp;a&nbsp;record&nbsp;with&nbsp;some&nbsp;of&nbsp;the&nbsp;following</span></span></span></div><div class="line"><a name="line653"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;attributes:</span></span></span></div><div class="line"><a name="line654"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line655"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**value**&nbsp;The&nbsp;value&nbsp;associated&nbsp;with&nbsp;the&nbsp;property&nbsp;(data</span></span></span></div><div class="line"><a name="line656"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;descriptors&nbsp;only).</span></span></span></div><div class="line"><a name="line657"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line658"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**writable**&nbsp;True&nbsp;if&nbsp;and&nbsp;only&nbsp;if&nbsp;the&nbsp;value&nbsp;associated&nbsp;with</span></span></span></div><div class="line"><a name="line659"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;the&nbsp;property&nbsp;may&nbsp;be&nbsp;changed&nbsp;(data&nbsp;descriptors&nbsp;only).</span></span></span></div><div class="line"><a name="line660"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line661"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**get**&nbsp;A&nbsp;function&nbsp;which&nbsp;serves&nbsp;as&nbsp;a&nbsp;getter&nbsp;for&nbsp;the&nbsp;property,</span></span></span></div><div class="line"><a name="line662"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;undefined&nbsp;if&nbsp;there&nbsp;is&nbsp;no&nbsp;getter&nbsp;(accessor&nbsp;descriptors&nbsp;only).</span></span></span></div><div class="line"><a name="line663"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line664"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**set**&nbsp;A&nbsp;function&nbsp;which&nbsp;serves&nbsp;as&nbsp;a&nbsp;setter&nbsp;for&nbsp;the&nbsp;property,</span></span></span></div><div class="line"><a name="line665"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;or&nbsp;undefined&nbsp;if&nbsp;there&nbsp;is&nbsp;no&nbsp;setter&nbsp;(accessor&nbsp;descriptors&nbsp;only).</span></span></span></div><div class="line"><a name="line666"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line667"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**configurable**&nbsp;true&nbsp;if&nbsp;and&nbsp;only&nbsp;if&nbsp;the&nbsp;type&nbsp;of&nbsp;this&nbsp;property</span></span></span></div><div class="line"><a name="line668"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;descriptor&nbsp;may&nbsp;be&nbsp;changed&nbsp;and&nbsp;if&nbsp;the&nbsp;property&nbsp;may&nbsp;be&nbsp;deleted</span></span></span></div><div class="line"><a name="line669"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;from&nbsp;the&nbsp;corresponding&nbsp;object.</span></span></span></div><div class="line"><a name="line670"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line671"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;-&nbsp;**enumerable**&nbsp;true&nbsp;if&nbsp;and&nbsp;only&nbsp;if&nbsp;this&nbsp;property&nbsp;shows&nbsp;up</span></span></span></div><div class="line"><a name="line672"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;during&nbsp;enumeration&nbsp;of&nbsp;the&nbsp;properties&nbsp;on&nbsp;the&nbsp;corresponding&nbsp;object.</span></span></span></div><div class="line"><a name="line673"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line674"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Mixed}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>Value</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>of&nbsp;the&nbsp;property&nbsp;descriptor.</span></span></span></span></span></div><div class="line"><a name="line675"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line676"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line677"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line678"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;keys</span></span></span></div><div class="line"><a name="line679"><a name="Object-static-method-keys"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line680"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line681"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;an&nbsp;array&nbsp;of&nbsp;a&nbsp;given&nbsp;object&#39;s&nbsp;own&nbsp;enumerable&nbsp;properties,&nbsp;in</span></span></span></div><div class="line"><a name="line682"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;the&nbsp;same&nbsp;order&nbsp;as&nbsp;that&nbsp;provided&nbsp;by&nbsp;a&nbsp;for-in&nbsp;loop&nbsp;(the&nbsp;difference</span></span></span></div><div class="line"><a name="line683"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;being&nbsp;that&nbsp;a&nbsp;for-in&nbsp;loop&nbsp;enumerates&nbsp;properties&nbsp;in&nbsp;the&nbsp;prototype</span></span></span></div><div class="line"><a name="line684"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;chain&nbsp;as&nbsp;well).</span></span></span></div><div class="line"><a name="line685"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line686"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;an&nbsp;array&nbsp;whose&nbsp;elements&nbsp;are&nbsp;strings&nbsp;corresponding&nbsp;to&nbsp;the</span></span></span></div><div class="line"><a name="line687"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;enumerable&nbsp;properties&nbsp;found&nbsp;directly&nbsp;upon&nbsp;object.&nbsp;The&nbsp;ordering&nbsp;of</span></span></span></div><div class="line"><a name="line688"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;the&nbsp;properties&nbsp;is&nbsp;the&nbsp;same&nbsp;as&nbsp;that&nbsp;given&nbsp;by&nbsp;looping&nbsp;over&nbsp;the</span></span></span></div><div class="line"><a name="line689"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;properties&nbsp;of&nbsp;the&nbsp;object&nbsp;manually.</span></span></span></div><div class="line"><a name="line690"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line691"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;arr&nbsp;=&nbsp;[&quot;a&quot;,&nbsp;&quot;b&quot;,&nbsp;&quot;c&quot;];</span></span></span></div><div class="line"><a name="line692"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(Object.keys(arr));&nbsp;//&nbsp;will&nbsp;alert&nbsp;&quot;0,1,2&quot;</span></span></span></div><div class="line"><a name="line693"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line694"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;array&nbsp;like&nbsp;object</span></span></span></div><div class="line"><a name="line695"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;obj&nbsp;=&nbsp;{&nbsp;0&nbsp;:&nbsp;&quot;a&quot;,&nbsp;1&nbsp;:&nbsp;&quot;b&quot;,&nbsp;2&nbsp;:&nbsp;&quot;c&quot;};</span></span></span></div><div class="line"><a name="line696"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(Object.keys(obj));&nbsp;//&nbsp;will&nbsp;alert&nbsp;&quot;0,1,2&quot;</span></span></span></div><div class="line"><a name="line697"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line698"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;getFoo&nbsp;is&nbsp;property&nbsp;which&nbsp;isn&#39;t&nbsp;enumerable</span></span></span></div><div class="line"><a name="line699"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;my_obj&nbsp;=&nbsp;Object.create({},&nbsp;{&nbsp;getFoo&nbsp;:&nbsp;{&nbsp;value&nbsp;:&nbsp;function&nbsp;()&nbsp;{&nbsp;return&nbsp;this.foo&nbsp;}&nbsp;}&nbsp;});</span></span></span></div><div class="line"><a name="line700"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my_obj.foo&nbsp;=&nbsp;1;</span></span></span></div><div class="line"><a name="line701"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line702"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(Object.keys(my_obj));&nbsp;//&nbsp;will&nbsp;alert&nbsp;only&nbsp;foo</span></span></span></div><div class="line"><a name="line703"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line704"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;If&nbsp;you&nbsp;want&nbsp;all&nbsp;properties,&nbsp;even&nbsp;the&nbsp;not&nbsp;enumerable,&nbsp;see</span></span></span></div><div class="line"><a name="line705"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;{@link&nbsp;Object#getOwnPropertyNames}.</span></span></span></div><div class="line"><a name="line706"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line707"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line708"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line709"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;whose&nbsp;enumerable&nbsp;own&nbsp;properties&nbsp;are</span></span></span></span></span></div><div class="line"><a name="line710"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;to&nbsp;be&nbsp;returned.</span></span></span></div><div class="line"><a name="line711"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;{String[]}&nbsp;Array&nbsp;of&nbsp;property&nbsp;names.</span></span></span></div><div class="line"><a name="line712"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line713"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line714"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line715"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;getOwnPropertyNames</span></span></span></div><div class="line"><a name="line716"><a name="Object-static-method-getOwnPropertyNames"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line717"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line718"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;an&nbsp;array&nbsp;of&nbsp;all&nbsp;properties&nbsp;(enumerable&nbsp;or&nbsp;not)&nbsp;found</span></span></span></div><div class="line"><a name="line719"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;directly&nbsp;upon&nbsp;a&nbsp;given&nbsp;object.</span></span></span></div><div class="line"><a name="line720"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line721"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Rreturns&nbsp;an&nbsp;array&nbsp;whose&nbsp;elements&nbsp;are&nbsp;strings&nbsp;corresponding&nbsp;to&nbsp;the</span></span></span></div><div class="line"><a name="line722"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;enumerable&nbsp;and&nbsp;non-enumerable&nbsp;properties&nbsp;found&nbsp;directly&nbsp;upon</span></span></span></div><div class="line"><a name="line723"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;obj.&nbsp;The&nbsp;ordering&nbsp;of&nbsp;the&nbsp;enumerable&nbsp;properties&nbsp;in&nbsp;the&nbsp;array&nbsp;is</span></span></span></div><div class="line"><a name="line724"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;consistent&nbsp;with&nbsp;the&nbsp;ordering&nbsp;exposed&nbsp;by&nbsp;a&nbsp;for...in&nbsp;loop&nbsp;(or&nbsp;by</span></span></span></div><div class="line"><a name="line725"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;{@link&nbsp;Object#keys})&nbsp;over&nbsp;the&nbsp;properties&nbsp;of&nbsp;the&nbsp;object.&nbsp;The</span></span></span></div><div class="line"><a name="line726"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;ordering&nbsp;of&nbsp;the&nbsp;non-enumerable&nbsp;properties&nbsp;in&nbsp;the&nbsp;array,&nbsp;and&nbsp;among</span></span></span></div><div class="line"><a name="line727"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;the&nbsp;enumerable&nbsp;properties,&nbsp;is&nbsp;not&nbsp;defined.</span></span></span></div><div class="line"><a name="line728"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line729"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;arr&nbsp;=&nbsp;[&quot;a&quot;,&nbsp;&quot;b&quot;,&nbsp;&quot;c&quot;];</span></span></span></div><div class="line"><a name="line730"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(Object.getOwnPropertyNames(arr).sort());&nbsp;//&nbsp;prints&nbsp;&quot;0,1,2,length&quot;</span></span></span></div><div class="line"><a name="line731"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line732"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Array-like&nbsp;object</span></span></span></div><div class="line"><a name="line733"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;obj&nbsp;=&nbsp;{&nbsp;0:&nbsp;&quot;a&quot;,&nbsp;1:&nbsp;&quot;b&quot;,&nbsp;2:&nbsp;&quot;c&quot;};</span></span></span></div><div class="line"><a name="line734"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(Object.getOwnPropertyNames(obj).sort());&nbsp;//&nbsp;prints&nbsp;&quot;0,1,2&quot;</span></span></span></div><div class="line"><a name="line735"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line736"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Printing&nbsp;property&nbsp;names&nbsp;and&nbsp;values&nbsp;using&nbsp;Array.forEach</span></span></span></div><div class="line"><a name="line737"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.getOwnPropertyNames(obj).forEach(function(val,&nbsp;idx,&nbsp;array)&nbsp;{</span></span></span></div><div class="line"><a name="line738"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(val&nbsp;+&nbsp;&quot;&nbsp;-&gt;&nbsp;&quot;&nbsp;+&nbsp;obj[val]);</span></span></span></div><div class="line"><a name="line739"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</span></span></span></div><div class="line"><a name="line740"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;prints</span></span></span></div><div class="line"><a name="line741"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;0&nbsp;-&gt;&nbsp;a</span></span></span></div><div class="line"><a name="line742"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;1&nbsp;-&gt;&nbsp;b</span></span></span></div><div class="line"><a name="line743"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;2&nbsp;-&gt;&nbsp;c</span></span></span></div><div class="line"><a name="line744"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line745"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;non-enumerable&nbsp;property</span></span></span></div><div class="line"><a name="line746"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;my_obj&nbsp;=&nbsp;Object.create({},&nbsp;{&nbsp;getFoo:&nbsp;{&nbsp;value:&nbsp;function()&nbsp;{&nbsp;return&nbsp;this.foo;&nbsp;},&nbsp;enumerable:&nbsp;false&nbsp;}&nbsp;});</span></span></span></div><div class="line"><a name="line747"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my_obj.foo&nbsp;=&nbsp;1;</span></span></span></div><div class="line"><a name="line748"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line749"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(Object.getOwnPropertyNames(my_obj).sort());&nbsp;//&nbsp;prints&nbsp;&quot;foo,&nbsp;getFoo&quot;</span></span></span></div><div class="line"><a name="line750"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line751"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;If&nbsp;you&nbsp;want&nbsp;only&nbsp;the&nbsp;enumerable&nbsp;properties,&nbsp;see&nbsp;{@link&nbsp;Object#keys}</span></span></span></div><div class="line"><a name="line752"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;or&nbsp;use&nbsp;a&nbsp;for...in&nbsp;loop&nbsp;(although&nbsp;note&nbsp;that&nbsp;this&nbsp;will&nbsp;return</span></span></span></div><div class="line"><a name="line753"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;enumerable&nbsp;properties&nbsp;not&nbsp;found&nbsp;directly&nbsp;upon&nbsp;that&nbsp;object&nbsp;but&nbsp;also</span></span></span></div><div class="line"><a name="line754"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;along&nbsp;the&nbsp;prototype&nbsp;chain&nbsp;for&nbsp;the&nbsp;object&nbsp;unless&nbsp;the&nbsp;latter&nbsp;is</span></span></span></div><div class="line"><a name="line755"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;filtered&nbsp;with&nbsp;{@link&nbsp;#hasOwnProperty}).</span></span></span></div><div class="line"><a name="line756"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line757"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Items&nbsp;on&nbsp;the&nbsp;prototype&nbsp;chain&nbsp;are&nbsp;not&nbsp;listed:</span></span></span></div><div class="line"><a name="line758"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line759"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;ParentClass&nbsp;()&nbsp;{</span></span></span></div><div class="line"><a name="line760"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line761"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ParentClass.prototype.inheritedMethod&nbsp;=&nbsp;function&nbsp;()&nbsp;{</span></span></span></div><div class="line"><a name="line762"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></span></span></div><div class="line"><a name="line763"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line764"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;ChildClass&nbsp;()&nbsp;{</span></span></span></div><div class="line"><a name="line765"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.prop&nbsp;=&nbsp;5;</span></span></span></div><div class="line"><a name="line766"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.method&nbsp;=&nbsp;function&nbsp;()&nbsp;{};</span></span></span></div><div class="line"><a name="line767"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line768"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChildClass.prototype&nbsp;=&nbsp;new&nbsp;ParentClass;</span></span></span></div><div class="line"><a name="line769"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChildClass.prototype.prototypeMethod&nbsp;=&nbsp;function&nbsp;()&nbsp;{</span></span></span></div><div class="line"><a name="line770"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</span></span></span></div><div class="line"><a name="line771"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line772"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(</span></span></span></div><div class="line"><a name="line773"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.getOwnPropertyNames(</span></span></span></div><div class="line"><a name="line774"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;ChildClass()&nbsp;//&nbsp;[&quot;prop&quot;,&nbsp;&quot;method&quot;]</span></span></span></div><div class="line"><a name="line775"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)</span></span></span></div><div class="line"><a name="line776"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)</span></span></span></div><div class="line"><a name="line777"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line778"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line779"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line780"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;whose&nbsp;enumerable&nbsp;and&nbsp;non-enumerable</span></span></span></span></span></div><div class="line"><a name="line781"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;own&nbsp;properties&nbsp;are&nbsp;to&nbsp;be&nbsp;returned.</span></span></span></div><div class="line"><a name="line782"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;{String[]}&nbsp;Array&nbsp;of&nbsp;property&nbsp;names.</span></span></span></div><div class="line"><a name="line783"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line784"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line785"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line786"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;getPrototypeOf</span></span></span></div><div class="line"><a name="line787"><a name="Object-static-method-getPrototypeOf"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line788"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line789"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Returns&nbsp;the&nbsp;prototype&nbsp;(i.e.&nbsp;the&nbsp;internal&nbsp;`[[Prototype]]`)&nbsp;of&nbsp;the</span></span></span></div><div class="line"><a name="line790"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;specified&nbsp;object.</span></span></span></div><div class="line"><a name="line791"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line792"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line793"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line794"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>object</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;whose&nbsp;prototype&nbsp;is&nbsp;to&nbsp;be&nbsp;returned.</span></span></span></span></span></div><div class="line"><a name="line795"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Throws&nbsp;a&nbsp;TypeError&nbsp;exception&nbsp;if&nbsp;this&nbsp;parameter&nbsp;isn&#39;t&nbsp;an&nbsp;Object.</span></span></span></div><div class="line"><a name="line796"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line797"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>the</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>prototype</span></span></span></span></span></div><div class="line"><a name="line798"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line799"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line800"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line801"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;preventExtensions</span></span></span></div><div class="line"><a name="line802"><a name="Object-static-method-preventExtensions"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line803"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line804"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Prevents&nbsp;new&nbsp;properties&nbsp;from&nbsp;ever&nbsp;being&nbsp;added&nbsp;to&nbsp;an&nbsp;object</span></span></span></div><div class="line"><a name="line805"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;(i.e.&nbsp;prevents&nbsp;future&nbsp;extensions&nbsp;to&nbsp;the&nbsp;object).</span></span></span></div><div class="line"><a name="line806"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line807"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;An&nbsp;object&nbsp;is&nbsp;extensible&nbsp;if&nbsp;new&nbsp;properties&nbsp;can&nbsp;be&nbsp;added&nbsp;to&nbsp;it.</span></span></span></div><div class="line"><a name="line808"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;`preventExtensions`&nbsp;marks&nbsp;an&nbsp;object&nbsp;as&nbsp;no&nbsp;longer&nbsp;extensible,&nbsp;so&nbsp;that</span></span></span></div><div class="line"><a name="line809"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;it&nbsp;will&nbsp;never&nbsp;have&nbsp;properties&nbsp;beyond&nbsp;the&nbsp;ones&nbsp;it&nbsp;had&nbsp;at&nbsp;the&nbsp;time&nbsp;it</span></span></span></div><div class="line"><a name="line810"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;was&nbsp;marked&nbsp;as&nbsp;non-extensible.&nbsp;&nbsp;Note&nbsp;that&nbsp;the&nbsp;properties&nbsp;of&nbsp;a</span></span></span></div><div class="line"><a name="line811"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;non-extensible&nbsp;object,&nbsp;in&nbsp;general,&nbsp;may&nbsp;still&nbsp;be&nbsp;deleted.&nbsp;Attempting</span></span></span></div><div class="line"><a name="line812"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;to&nbsp;add&nbsp;new&nbsp;properties&nbsp;to&nbsp;a&nbsp;non-extensible&nbsp;object&nbsp;will&nbsp;fail,&nbsp;either</span></span></span></div><div class="line"><a name="line813"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;silently&nbsp;or&nbsp;by&nbsp;throwing&nbsp;a&nbsp;TypeError&nbsp;(most&nbsp;commonly,&nbsp;but&nbsp;not</span></span></span></div><div class="line"><a name="line814"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;exclusively,&nbsp;when&nbsp;in&nbsp;strict&nbsp;mode).</span></span></span></div><div class="line"><a name="line815"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line816"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;It&nbsp;only&nbsp;prevents&nbsp;addition&nbsp;of&nbsp;own&nbsp;properties.&nbsp;Properties&nbsp;can&nbsp;still</span></span></span></div><div class="line"><a name="line817"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;be&nbsp;added&nbsp;to&nbsp;the&nbsp;object&nbsp;prototype.</span></span></span></div><div class="line"><a name="line818"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line819"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;If&nbsp;there&nbsp;is&nbsp;a&nbsp;way&nbsp;to&nbsp;turn&nbsp;an&nbsp;extensible&nbsp;object&nbsp;to&nbsp;a&nbsp;non-extensible</span></span></span></div><div class="line"><a name="line820"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;one,&nbsp;there&nbsp;is&nbsp;no&nbsp;way&nbsp;to&nbsp;do&nbsp;the&nbsp;opposite&nbsp;in&nbsp;ECMAScript&nbsp;5</span></span></span></div><div class="line"><a name="line821"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line822"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line823"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line824"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;which&nbsp;should&nbsp;be&nbsp;made&nbsp;non-extensible.</span></span></span></span></span></div><div class="line"><a name="line825"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line826"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line827"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line828"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;isExtensible</span></span></span></div><div class="line"><a name="line829"><a name="Object-static-method-isExtensible"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line830"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line831"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Determines&nbsp;if&nbsp;an&nbsp;object&nbsp;is&nbsp;extensible&nbsp;(whether&nbsp;it&nbsp;can&nbsp;have&nbsp;new</span></span></span></div><div class="line"><a name="line832"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;properties&nbsp;added&nbsp;to&nbsp;it).</span></span></span></div><div class="line"><a name="line833"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line834"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Objects&nbsp;are&nbsp;extensible&nbsp;by&nbsp;default:&nbsp;they&nbsp;can&nbsp;have&nbsp;new&nbsp;properties</span></span></span></div><div class="line"><a name="line835"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;added&nbsp;to&nbsp;them,&nbsp;and&nbsp;can&nbsp;be&nbsp;modified.&nbsp;An&nbsp;object&nbsp;can&nbsp;be&nbsp;marked&nbsp;as</span></span></span></div><div class="line"><a name="line836"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;non-extensible&nbsp;using&nbsp;{@link&nbsp;Object#preventExtensions},</span></span></span></div><div class="line"><a name="line837"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;{@link&nbsp;Object#seal},&nbsp;or&nbsp;{@link&nbsp;Object#freeze}.</span></span></span></div><div class="line"><a name="line838"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line839"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;New&nbsp;objects&nbsp;are&nbsp;extensible.</span></span></span></div><div class="line"><a name="line840"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;empty&nbsp;=&nbsp;{};</span></span></span></div><div class="line"><a name="line841"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isExtensible(empty)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line842"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line843"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;...but&nbsp;that&nbsp;can&nbsp;be&nbsp;changed.</span></span></span></div><div class="line"><a name="line844"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.preventExtensions(empty);</span></span></span></div><div class="line"><a name="line845"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isExtensible(empty)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line846"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line847"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Sealed&nbsp;objects&nbsp;are&nbsp;by&nbsp;definition&nbsp;non-extensible.</span></span></span></div><div class="line"><a name="line848"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;sealed&nbsp;=&nbsp;Object.seal({});</span></span></span></div><div class="line"><a name="line849"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isExtensible(sealed)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line850"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line851"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Frozen&nbsp;objects&nbsp;are&nbsp;also&nbsp;by&nbsp;definition&nbsp;non-extensible.</span></span></span></div><div class="line"><a name="line852"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;frozen&nbsp;=&nbsp;Object.freeze({});</span></span></span></div><div class="line"><a name="line853"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isExtensible(frozen)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line854"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line855"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line856"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line857"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;which&nbsp;should&nbsp;be&nbsp;checked.</span></span></span></span></span></div><div class="line"><a name="line858"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Boolean}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>True</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>when&nbsp;object&nbsp;is&nbsp;extensible.</span></span></span></span></span></div><div class="line"><a name="line859"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line860"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line861"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line862"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;seal</span></span></span></div><div class="line"><a name="line863"><a name="Object-static-method-seal"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line864"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line865"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Seals&nbsp;an&nbsp;object,&nbsp;preventing&nbsp;new&nbsp;properties&nbsp;from&nbsp;being&nbsp;added&nbsp;to&nbsp;it</span></span></span></div><div class="line"><a name="line866"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;and&nbsp;marking&nbsp;all&nbsp;existing&nbsp;properties&nbsp;as&nbsp;non-configurable.&nbsp;Values&nbsp;of</span></span></span></div><div class="line"><a name="line867"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;present&nbsp;properties&nbsp;can&nbsp;still&nbsp;be&nbsp;changed&nbsp;as&nbsp;long&nbsp;as&nbsp;they&nbsp;are</span></span></span></div><div class="line"><a name="line868"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;writable.</span></span></span></div><div class="line"><a name="line869"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line870"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;By&nbsp;default,&nbsp;objects&nbsp;are&nbsp;extensible&nbsp;(new&nbsp;properties&nbsp;can&nbsp;be&nbsp;added&nbsp;to</span></span></span></div><div class="line"><a name="line871"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;them).&nbsp;Sealing&nbsp;an&nbsp;object&nbsp;prevents&nbsp;new&nbsp;properties&nbsp;from&nbsp;being&nbsp;added</span></span></span></div><div class="line"><a name="line872"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;and&nbsp;marks&nbsp;all&nbsp;existing&nbsp;properties&nbsp;as&nbsp;non-configurable.&nbsp;This&nbsp;has&nbsp;the</span></span></span></div><div class="line"><a name="line873"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;effect&nbsp;of&nbsp;making&nbsp;the&nbsp;set&nbsp;of&nbsp;properties&nbsp;on&nbsp;the&nbsp;object&nbsp;fixed&nbsp;and</span></span></span></div><div class="line"><a name="line874"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;immutable.&nbsp;Making&nbsp;all&nbsp;properties&nbsp;non-configurable&nbsp;also&nbsp;prevents</span></span></span></div><div class="line"><a name="line875"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;them&nbsp;from&nbsp;being&nbsp;converted&nbsp;from&nbsp;data&nbsp;properties&nbsp;to&nbsp;accessor</span></span></span></div><div class="line"><a name="line876"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;properties&nbsp;and&nbsp;vice&nbsp;versa,&nbsp;but&nbsp;it&nbsp;does&nbsp;not&nbsp;prevent&nbsp;the&nbsp;values&nbsp;of</span></span></span></div><div class="line"><a name="line877"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;data&nbsp;properties&nbsp;from&nbsp;being&nbsp;changed.&nbsp;Attempting&nbsp;to&nbsp;delete&nbsp;or&nbsp;add</span></span></span></div><div class="line"><a name="line878"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;properties&nbsp;to&nbsp;a&nbsp;sealed&nbsp;object,&nbsp;or&nbsp;to&nbsp;convert&nbsp;a&nbsp;data&nbsp;property&nbsp;to</span></span></span></div><div class="line"><a name="line879"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;accessor&nbsp;or&nbsp;vice&nbsp;versa,&nbsp;will&nbsp;fail,&nbsp;either&nbsp;silently&nbsp;or&nbsp;by&nbsp;throwing&nbsp;a</span></span></span></div><div class="line"><a name="line880"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;TypeError&nbsp;(most&nbsp;commonly,&nbsp;although&nbsp;not&nbsp;exclusively,&nbsp;when&nbsp;in&nbsp;strict</span></span></span></div><div class="line"><a name="line881"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;mode&nbsp;code).</span></span></span></div><div class="line"><a name="line882"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line883"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;prototype&nbsp;chain&nbsp;remains&nbsp;untouched.</span></span></span></div><div class="line"><a name="line884"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line885"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line886"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line887"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;which&nbsp;should&nbsp;be&nbsp;sealed.</span></span></span></span></span></div><div class="line"><a name="line888"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line889"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line890"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line891"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;isSealed</span></span></span></div><div class="line"><a name="line892"><a name="Object-static-method-isSealed"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line893"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line894"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Determines&nbsp;if&nbsp;an&nbsp;object&nbsp;is&nbsp;sealed.</span></span></span></div><div class="line"><a name="line895"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line896"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;An&nbsp;object&nbsp;is&nbsp;sealed&nbsp;if&nbsp;it&nbsp;is&nbsp;non-extensible&nbsp;and&nbsp;if&nbsp;all&nbsp;its</span></span></span></div><div class="line"><a name="line897"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;properties&nbsp;are&nbsp;non-configurable&nbsp;and&nbsp;therefore&nbsp;not&nbsp;removable&nbsp;(but</span></span></span></div><div class="line"><a name="line898"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;not&nbsp;necessarily&nbsp;non-writable).</span></span></span></div><div class="line"><a name="line899"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line900"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Objects&nbsp;aren&#39;t&nbsp;sealed&nbsp;by&nbsp;default.</span></span></span></div><div class="line"><a name="line901"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;empty&nbsp;=&nbsp;{};</span></span></span></div><div class="line"><a name="line902"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isSealed(empty)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line903"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line904"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;If&nbsp;you&nbsp;make&nbsp;an&nbsp;empty&nbsp;object&nbsp;non-extensible,&nbsp;it&nbsp;is&nbsp;vacuously&nbsp;sealed.</span></span></span></div><div class="line"><a name="line905"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.preventExtensions(empty);</span></span></span></div><div class="line"><a name="line906"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isSealed(empty)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line907"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line908"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;The&nbsp;same&nbsp;is&nbsp;not&nbsp;true&nbsp;of&nbsp;a&nbsp;non-empty&nbsp;object,&nbsp;unless&nbsp;its&nbsp;properties&nbsp;are&nbsp;all&nbsp;non-configurable.</span></span></span></div><div class="line"><a name="line909"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;hasProp&nbsp;=&nbsp;{&nbsp;fee:&nbsp;&quot;fie&nbsp;foe&nbsp;fum&quot;&nbsp;};</span></span></span></div><div class="line"><a name="line910"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.preventExtensions(hasProp);</span></span></span></div><div class="line"><a name="line911"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isSealed(hasProp)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line912"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line913"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;But&nbsp;make&nbsp;them&nbsp;all&nbsp;non-configurable&nbsp;and&nbsp;the&nbsp;object&nbsp;becomes&nbsp;sealed.</span></span></span></div><div class="line"><a name="line914"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.defineProperty(hasProp,&nbsp;&quot;fee&quot;,&nbsp;{&nbsp;configurable:&nbsp;false&nbsp;});</span></span></span></div><div class="line"><a name="line915"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isSealed(hasProp)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line916"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line917"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;The&nbsp;easiest&nbsp;way&nbsp;to&nbsp;seal&nbsp;an&nbsp;object,&nbsp;of&nbsp;course,&nbsp;is&nbsp;Object.seal.</span></span></span></div><div class="line"><a name="line918"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;sealed&nbsp;=&nbsp;{};</span></span></span></div><div class="line"><a name="line919"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.seal(sealed);</span></span></span></div><div class="line"><a name="line920"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isSealed(sealed)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line921"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line922"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;A&nbsp;sealed&nbsp;object&nbsp;is,&nbsp;by&nbsp;definition,&nbsp;non-extensible.</span></span></span></div><div class="line"><a name="line923"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isExtensible(sealed)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line924"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line925"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;A&nbsp;sealed&nbsp;object&nbsp;might&nbsp;be&nbsp;frozen,&nbsp;but&nbsp;it&nbsp;doesn&#39;t&nbsp;have&nbsp;to&nbsp;be.</span></span></span></div><div class="line"><a name="line926"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(sealed)&nbsp;===&nbsp;true);&nbsp;//&nbsp;all&nbsp;properties&nbsp;also&nbsp;non-writable</span></span></span></div><div class="line"><a name="line927"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line928"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;s2&nbsp;=&nbsp;Object.seal({&nbsp;p:&nbsp;3&nbsp;});</span></span></span></div><div class="line"><a name="line929"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(s2)&nbsp;===&nbsp;false);&nbsp;//&nbsp;&quot;p&quot;&nbsp;is&nbsp;still&nbsp;writable</span></span></span></div><div class="line"><a name="line930"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line931"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;s3&nbsp;=&nbsp;Object.seal({&nbsp;get&nbsp;p()&nbsp;{&nbsp;return&nbsp;0;&nbsp;}&nbsp;});</span></span></span></div><div class="line"><a name="line932"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(s3)&nbsp;===&nbsp;true);&nbsp;//&nbsp;only&nbsp;configurability&nbsp;matters&nbsp;for&nbsp;accessor&nbsp;properties</span></span></span></div><div class="line"><a name="line933"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line934"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line935"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line936"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;which&nbsp;should&nbsp;be&nbsp;checked.</span></span></span></span></span></div><div class="line"><a name="line937"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Boolean}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>True</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>if&nbsp;the&nbsp;object&nbsp;is&nbsp;sealed,&nbsp;otherwise&nbsp;false.</span></span></span></span></span></div><div class="line"><a name="line938"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line939"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line940"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line941"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;freeze</span></span></span></div><div class="line"><a name="line942"><a name="Object-static-method-freeze"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line943"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line944"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Freezes&nbsp;an&nbsp;object:&nbsp;that&nbsp;is,&nbsp;prevents&nbsp;new&nbsp;properties&nbsp;from&nbsp;being</span></span></span></div><div class="line"><a name="line945"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;added&nbsp;to&nbsp;it;&nbsp;prevents&nbsp;existing&nbsp;properties&nbsp;from&nbsp;being&nbsp;removed;&nbsp;and</span></span></span></div><div class="line"><a name="line946"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;prevents&nbsp;existing&nbsp;properties,&nbsp;or&nbsp;their&nbsp;enumerability,</span></span></span></div><div class="line"><a name="line947"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;configurability,&nbsp;or&nbsp;writability,&nbsp;from&nbsp;being&nbsp;changed.&nbsp;In&nbsp;essence&nbsp;the</span></span></span></div><div class="line"><a name="line948"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;object&nbsp;is&nbsp;made&nbsp;effectively&nbsp;immutable.&nbsp;The&nbsp;method&nbsp;returns&nbsp;the&nbsp;object</span></span></span></div><div class="line"><a name="line949"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;being&nbsp;frozen.</span></span></span></div><div class="line"><a name="line950"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line951"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Nothing&nbsp;can&nbsp;be&nbsp;added&nbsp;to&nbsp;or&nbsp;removed&nbsp;from&nbsp;the&nbsp;properties&nbsp;set&nbsp;of&nbsp;a</span></span></span></div><div class="line"><a name="line952"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;frozen&nbsp;object.&nbsp;Any&nbsp;attempt&nbsp;to&nbsp;do&nbsp;so&nbsp;will&nbsp;fail,&nbsp;either&nbsp;silently&nbsp;or</span></span></span></div><div class="line"><a name="line953"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;by&nbsp;throwing&nbsp;a&nbsp;TypeError&nbsp;exception&nbsp;(most&nbsp;commonly,&nbsp;but&nbsp;not</span></span></span></div><div class="line"><a name="line954"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;exclusively,&nbsp;when&nbsp;in&nbsp;strict&nbsp;mode).</span></span></span></div><div class="line"><a name="line955"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line956"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Values&nbsp;cannot&nbsp;be&nbsp;changed&nbsp;for&nbsp;data&nbsp;properties.&nbsp;Accessor&nbsp;properties</span></span></span></div><div class="line"><a name="line957"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;(getters&nbsp;and&nbsp;setters)&nbsp;work&nbsp;the&nbsp;same&nbsp;(and&nbsp;still&nbsp;give&nbsp;the&nbsp;illusion</span></span></span></div><div class="line"><a name="line958"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;that&nbsp;you&nbsp;are&nbsp;changing&nbsp;the&nbsp;value).&nbsp;Note&nbsp;that&nbsp;values&nbsp;that&nbsp;are&nbsp;objects</span></span></span></div><div class="line"><a name="line959"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;can&nbsp;still&nbsp;be&nbsp;modified,&nbsp;unless&nbsp;they&nbsp;are&nbsp;also&nbsp;frozen.</span></span></span></div><div class="line"><a name="line960"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line961"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line962"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line963"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;to&nbsp;freeze.</span></span></span></span></span></div><div class="line"><a name="line964"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line965"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line966"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line967"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;isFrozen</span></span></span></div><div class="line"><a name="line968"><a name="Object-static-method-isFrozen"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@static</span></span></span></span></div><div class="line"><a name="line969"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line970"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Determines&nbsp;if&nbsp;an&nbsp;object&nbsp;is&nbsp;frozen.</span></span></span></div><div class="line"><a name="line971"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line972"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;An&nbsp;object&nbsp;is&nbsp;frozen&nbsp;if&nbsp;and&nbsp;only&nbsp;if&nbsp;it&nbsp;is&nbsp;not&nbsp;extensible,&nbsp;all&nbsp;its</span></span></span></div><div class="line"><a name="line973"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;properties&nbsp;are&nbsp;non-configurable,&nbsp;and&nbsp;all&nbsp;its&nbsp;data&nbsp;properties&nbsp;(that</span></span></span></div><div class="line"><a name="line974"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;is,&nbsp;properties&nbsp;which&nbsp;are&nbsp;not&nbsp;accessor&nbsp;properties&nbsp;with&nbsp;getter&nbsp;or</span></span></span></div><div class="line"><a name="line975"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;setter&nbsp;components)&nbsp;are&nbsp;non-writable.</span></span></span></div><div class="line"><a name="line976"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line977"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;A&nbsp;new&nbsp;object&nbsp;is&nbsp;extensible,&nbsp;so&nbsp;it&nbsp;is&nbsp;not&nbsp;frozen.</span></span></span></div><div class="line"><a name="line978"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen({})&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line979"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line980"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;An&nbsp;empty&nbsp;object&nbsp;which&nbsp;is&nbsp;not&nbsp;extensible&nbsp;is&nbsp;vacuously&nbsp;frozen.</span></span></span></div><div class="line"><a name="line981"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;vacuouslyFrozen&nbsp;=&nbsp;Object.preventExtensions({});</span></span></span></div><div class="line"><a name="line982"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(vacuouslyFrozen)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line983"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line984"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;A&nbsp;new&nbsp;object&nbsp;with&nbsp;one&nbsp;property&nbsp;is&nbsp;also&nbsp;extensible,&nbsp;ergo&nbsp;not&nbsp;frozen.</span></span></span></div><div class="line"><a name="line985"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;oneProp&nbsp;=&nbsp;{&nbsp;p:&nbsp;42&nbsp;};</span></span></span></div><div class="line"><a name="line986"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(oneProp)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line987"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line988"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Preventing&nbsp;extensions&nbsp;to&nbsp;the&nbsp;object&nbsp;still&nbsp;doesn&#39;t&nbsp;make&nbsp;it&nbsp;frozen,</span></span></span></div><div class="line"><a name="line989"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;because&nbsp;the&nbsp;property&nbsp;is&nbsp;still&nbsp;configurable&nbsp;(and&nbsp;writable).</span></span></span></div><div class="line"><a name="line990"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.preventExtensions(oneProp);</span></span></span></div><div class="line"><a name="line991"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(oneProp)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line992"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line993"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;...but&nbsp;then&nbsp;deleting&nbsp;that&nbsp;property&nbsp;makes&nbsp;the&nbsp;object&nbsp;vacuously&nbsp;frozen.</span></span></span></div><div class="line"><a name="line994"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete&nbsp;oneProp.p;</span></span></span></div><div class="line"><a name="line995"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(oneProp)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line996"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line997"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;A&nbsp;non-extensible&nbsp;object&nbsp;with&nbsp;a&nbsp;non-writable&nbsp;but&nbsp;still&nbsp;configurable&nbsp;property&nbsp;is&nbsp;not&nbsp;frozen.</span></span></span></div><div class="line"><a name="line998"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;nonWritable&nbsp;=&nbsp;{&nbsp;e:&nbsp;&quot;plep&quot;&nbsp;};</span></span></span></div><div class="line"><a name="line999"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.preventExtensions(nonWritable);</span></span></span></div><div class="line"><a name="line1000"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.defineProperty(nonWritable,&nbsp;&quot;e&quot;,&nbsp;{&nbsp;writable:&nbsp;false&nbsp;});&nbsp;//&nbsp;make&nbsp;non-writable</span></span></span></div><div class="line"><a name="line1001"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(nonWritable)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line1002"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1003"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Changing&nbsp;that&nbsp;property&nbsp;to&nbsp;non-configurable&nbsp;then&nbsp;makes&nbsp;the&nbsp;object&nbsp;frozen.</span></span></span></div><div class="line"><a name="line1004"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.defineProperty(nonWritable,&nbsp;&quot;e&quot;,&nbsp;{&nbsp;configurable:&nbsp;false&nbsp;});&nbsp;//&nbsp;make&nbsp;non-configurable</span></span></span></div><div class="line"><a name="line1005"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(nonWritable)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line1006"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1007"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;A&nbsp;non-extensible&nbsp;object&nbsp;with&nbsp;a&nbsp;non-configurable&nbsp;but&nbsp;still&nbsp;writable&nbsp;property&nbsp;also&nbsp;isn&#39;t&nbsp;frozen.</span></span></span></div><div class="line"><a name="line1008"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;nonConfigurable&nbsp;=&nbsp;{&nbsp;release:&nbsp;&quot;the&nbsp;kraken!&quot;&nbsp;};</span></span></span></div><div class="line"><a name="line1009"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.preventExtensions(nonConfigurable);</span></span></span></div><div class="line"><a name="line1010"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.defineProperty(nonConfigurable,&nbsp;&quot;release&quot;,&nbsp;{&nbsp;configurable:&nbsp;false&nbsp;});</span></span></span></div><div class="line"><a name="line1011"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(nonConfigurable)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line1012"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1013"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Changing&nbsp;that&nbsp;property&nbsp;to&nbsp;non-writable&nbsp;then&nbsp;makes&nbsp;the&nbsp;object&nbsp;frozen.</span></span></span></div><div class="line"><a name="line1014"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.defineProperty(nonConfigurable,&nbsp;&quot;release&quot;,&nbsp;{&nbsp;writable:&nbsp;false&nbsp;});</span></span></span></div><div class="line"><a name="line1015"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(nonConfigurable)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line1016"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1017"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;A&nbsp;non-extensible&nbsp;object&nbsp;with&nbsp;a&nbsp;configurable&nbsp;accessor&nbsp;property&nbsp;isn&#39;t&nbsp;frozen.</span></span></span></div><div class="line"><a name="line1018"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;accessor&nbsp;=&nbsp;{&nbsp;get&nbsp;food()&nbsp;{&nbsp;return&nbsp;&quot;yum&quot;;&nbsp;}&nbsp;};</span></span></span></div><div class="line"><a name="line1019"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.preventExtensions(accessor);</span></span></span></div><div class="line"><a name="line1020"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(accessor)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line1021"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1022"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;...but&nbsp;make&nbsp;that&nbsp;property&nbsp;non-configurable&nbsp;and&nbsp;it&nbsp;becomes&nbsp;frozen.</span></span></span></div><div class="line"><a name="line1023"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.defineProperty(accessor,&nbsp;&quot;food&quot;,&nbsp;{&nbsp;configurable:&nbsp;false&nbsp;});</span></span></span></div><div class="line"><a name="line1024"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(accessor)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line1025"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1026"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;But&nbsp;the&nbsp;easiest&nbsp;way&nbsp;for&nbsp;an&nbsp;object&nbsp;to&nbsp;be&nbsp;frozen&nbsp;is&nbsp;if&nbsp;Object.freeze&nbsp;has&nbsp;been&nbsp;called&nbsp;on&nbsp;it.</span></span></span></div><div class="line"><a name="line1027"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;frozen&nbsp;=&nbsp;{&nbsp;1:&nbsp;81&nbsp;};</span></span></span></div><div class="line"><a name="line1028"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(frozen)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line1029"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object.freeze(frozen);</span></span></span></div><div class="line"><a name="line1030"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isFrozen(frozen)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line1031"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1032"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;By&nbsp;definition,&nbsp;a&nbsp;frozen&nbsp;object&nbsp;is&nbsp;non-extensible.</span></span></span></div><div class="line"><a name="line1033"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isExtensible(frozen)&nbsp;===&nbsp;false);</span></span></span></div><div class="line"><a name="line1034"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1035"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Also&nbsp;by&nbsp;definition,&nbsp;a&nbsp;frozen&nbsp;object&nbsp;is&nbsp;sealed.</span></span></span></div><div class="line"><a name="line1036"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert(Object.isSealed(frozen)&nbsp;===&nbsp;true);</span></span></span></div><div class="line"><a name="line1037"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1038"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;**NOTE:**&nbsp;This&nbsp;method&nbsp;is&nbsp;part&nbsp;of&nbsp;the&nbsp;ECMAScript&nbsp;5&nbsp;standard.</span></span></span></div><div class="line"><a name="line1039"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line1040"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>obj</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>The&nbsp;object&nbsp;which&nbsp;should&nbsp;be&nbsp;checked.</span></span></span></span></span></div><div class="line"><a name="line1041"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Boolean}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>True</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>if&nbsp;the&nbsp;object&nbsp;is&nbsp;frozen,&nbsp;otherwise&nbsp;false.</span></span></span></span></span></div><div class="line"><a name="line1042"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div></pre>
</body>
<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-1396058-28', 'auto');
    ga('send', 'pageview');

</script>
</html>
